-3

I have a playground for model developement.

When running python manage.py makemigrations the Error

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 173, in handle
    migration_name=self.migration_name,
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 47, in changes
    changes = self._detect_changes(convert_apps, graph)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 132, in _detect_changes
    self.old_apps = self.from_state.concrete_apps
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/db/migrations/state.py", line 180, in concrete_apps
    self.apps = StateApps(self.real_apps, self.models, ignore_swappable=True)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/db/migrations/state.py", line 242, in __init__
    self.render_multiple(list(models.values()) + self.real_models)
  File "/home/IPP-HGW/dboe/anaconda2/lib/python2.7/site-packages/django/db/migrations/state.py", line 285, in render_multiple
    "for more" % (new_unrendered_models, get_docs_version())
django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [<ModelState: 'main.Component'>, <ModelState: 'main.MagneticConfig'>, <ModelState: 'main.NetStructure'>, <ModelState: 'main.Program'>, <ModelState: 'main.FilePath'>]
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.10/topics/migrations/#dependencies for more

Keeps occuring though i tried a hell of a lot:

  1. of course python manage.py makemigration <appName>
  2. python manage.py migrate <appName>
  3. drop all tables from the app
  4. python manage.py squashmigrations main 0001
  5. emptied the models.py file
  6. uncommented the app in settings
  7. read everything i could find on that
  8. flushing the whole database python manage.py flush

Any idea, how to solve this? Thanks, Daniel

Edit Nov_29: Stack trace added

1 Answers1

0

Finally i got the solution. I found out, that the migrations are stored in a file in the application folder. You can delete these by hand. Of course, you need to be very careful with this.

Take a look at this if you got the same problem.

Community
  • 1
  • 1