Migrations problem when integrating django-allauth

637 views
Skip to first unread message

Andrew

unread,
Dec 2, 2014, 6:08:59 PM12/2/14
to wag...@googlegroups.com
hi everyone,

firstly - thanks for creating wagtail - very cool! :)

i seem to have struck a problem when introducing django-allauth into the mix with wagtail.

Prior to installing it i had a working wagtail instance with some basic blog pages - everything seemed to be working.

After installation of allauth it looks like there's a problem with migrations.

when running manage.py migrate:
File "D:\Python27\Lib\site-packages\django\db\migrations\state.py", line 71, in render raise InvalidBasesError("Cannot resolve bases for %r\nThis can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)\n in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more" % new_unrendered_models)
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'blog.BlogPage'>, <ModelState: 'blog.BlogIndexPage'>]
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.7/topics/migrations/#dependencies for more

What I've tried so far is to follow the advice here: http://stackoverflow.com/a/25858659 however this has not changed anything for me. I've also tried https://code.djangoproject.com/ticket/22051#comment:12 with no success.
makemigrations runs (no changes detected) by migrate fails.

This is currently on Django 1.7.1 on a Windows box. django-allauth runs successfully within other apps on this box.

Has anyone come across this before and is there a fix?


thanks in advance

A

---issued command sequence below:
(env) D:\git\rebootv2.1\blog>python manage.py migrate
D:\Python27\Lib\site-packages\treebeard\mp_tree.py:102: RemovedInDjango18Warning: `MP_NodeManager.get_query_set` method
should be renamed `get_queryset`.
  class MP_NodeManager(models.Manager):

Operations to perform:
  Synchronize unmigrated apps: account, allauth, modelcluster, blog, compressor, facebook, wagtailsnippets, socialaccount
  Apply all migrations: core, wagtailusers, wagtailembeds, wagtailadmin, sessions, admin, wagtailcore, sites, auth, contenttypes, wagtaildocs, taggit, wagtailsearch, wagtailforms, wagtailredirects, wagtailimages
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying sites.0001_initial...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "D:\Python27\Lib\site-packages\django\core\management\__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "D:\Python27\Lib\site-packages\django\core\management\__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\Python27\Lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "D:\Python27\Lib\site-packages\django\core\management\base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "D:\Python27\Lib\site-packages\django\core\management\commands\migrate.py", line 160, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "D:\Python27\Lib\site-packages\django\db\migrations\executor.py", line 63, in migrate
    self.apply_migration(migration, fake=fake)
  File "D:\Python27\Lib\site-packages\django\db\migrations\executor.py", line 91, in apply_migration
    if self.detect_soft_applied(migration):
  File "D:\Python27\Lib\site-packages\django\db\migrations\executor.py", line 135, in detect_soft_applied
    apps = project_state.render()
  File "D:\Python27\Lib\site-packages\django\db\migrations\state.py", line 71, in render raise InvalidBasesError("Cannot resolve bases for %r\nThis can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)\n in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more" % new_unrendered_models)
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'blog.BlogPage'>, <ModelState: 'blog.BlogIndexPage'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)

(env) D:\git\rebootv2.1\blog>python manage.py makemigrations
D:\Python27\Lib\site-packages\treebeard\mp_tree.py:102: RemovedInDjango18Warning: `MP_NodeManager.get_query_set` method
should be renamed `get_queryset`.
  class MP_NodeManager(models.Manager):

No changes detected


Andrew

unread,
Dec 2, 2014, 7:10:15 PM12/2/14
to wag...@googlegroups.com
Seems to now be fixed.

manage.py migrate going through smoothly.

What I did to fix this was:
  1. disable all of the allauth apps within INSTALLED_APPS in settings.py
  2. run manage.py migrate
  3. enable all of the allauth apps and disable the wagtail app that was generated for the project (e.g. blog)
  4. run manage.py migrate again
  5. enable both sets of apps in INSTALLED_APPS
  6. run manage.py migrate again
seems to be happy now. hope this helps someone and saves them some time!
Reply all
Reply to author
Forward
0 new messages