Cannot resolve bases ??

715 views
Skip to first unread message

Niels Jakob Buch

unread,
Sep 12, 2015, 12:15:19 PM9/12/15
to Mezzanine Users
Im stuck in this annoying error. Trying to run the "python manage.py createdb" in the project root

[lots of error lines removed]
 
File "C:\Code\MEZ4\lib\site-packages\django\db\migrations\state.py", line 270, in render_multiple
   
"for more" % (new_unrendered_models, get_docs_version())
django
.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'myapp.myPage'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 
in an app with no migrations; see https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies for more



I am having a page that is used for an app:
class TrapsPage(Page, RichText):
    add_toc
= models.BooleanField(_("Add TOC"), default=False,

                                  help_text
=_("Include a list of child links"))


   
class Meta:
        verbose_name
= _("My Page")
        verbose_name_plural
= _("My Pages")


Can anyone point in a meaningful direction for further investigation...?

Niels Jakob Buch

unread,
Sep 13, 2015, 9:22:39 AM9/13/15
to Mezzanine Users
Nevermind, I found a solution:

Run "python manage.py makemigrations myapp" first to create migrations focused on your app...

Before the usual createdb stuff...

I still dont understand why this is an issue with a clean database.

Eduardo Rivas

unread,
Sep 13, 2015, 9:48:43 AM9/13/15
to mezzani...@googlegroups.com

I think Django wouldn't know how to create your application's tables without the migration files. Migrations are required with every concrete model in Django 1.7 and up.

Niels Jakob Buch

unread,
Sep 13, 2015, 10:27:42 AM9/13/15
to mezzani...@googlegroups.com
That explains the need for the first app-specific migrations.

What about mezzanine, does it come with built-in migrations.

On Sun, Sep 13, 2015 at 3:48 PM, Eduardo Rivas <jeriva...@gmail.com> wrote:

I think Django wouldn't know how to create your application's tables without the migration files. Migrations are required with every concrete model in Django 1.7 and up.

--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/x6oxLhpK7Io/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ken Bolton

unread,
Sep 13, 2015, 10:47:39 AM9/13/15
to mezzanine-users
Hi Niels,

Mezzanine does come with built-in migrations; pages, blog, core, forms, and gallery should interest you.

-ken

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.

Niels Jakob Buch

unread,
Sep 13, 2015, 11:36:48 AM9/13/15
to mezzani...@googlegroups.com
Now it all makes sense, thanks a lot!
Reply all
Reply to author
Forward
0 new messages