I think the end of the traceback is pretty telling: ValueError: Lookup failed for model referenced by field quedar.LearningGroup.members: quedar.User
You have a LearningGroup model with an attribute called members which is still referencing the original User model that was removed. -James On Mar 22, 2015 11:45 AM, "Markus Holtermann" <i...@markusholtermann.eu> wrote: > Hi, > > from the information you provided I can only guess you are migrating away > from a custom user model to the "normal" Django user model. This won't work > (out of the box). And even the way to migrate from the Django user model to > a custom user model is more of a workaround than a solution. Please see > https://docs.djangoproject.com/en/dev/topics/auth/customizing/#substituting-a-custom-user-model > for details. > > /Markus > > On March 22, 2015 7:16:57 PM GMT+01:00, somenxav...@gmail.com wrote: > >Hi, > > > >makemigrations works but migrate does not: > > > >[xan@mercuri gargamella]$ python manage.py makemigrations > >Migrations for 'quedar': > > 0003_auto_20150322_1813.py: > > - Create model Persona > > - Delete model User > > - Add field user to persona > > - Alter field members on dialectgroup > > - Alter field members on languagelevelgroup > > - Alter field members on learninggroup > > - Alter field members on learningpeople > > - Alter field members on teachinggroup > >[xan@mercuri gargamella]$ python manage.py migrate > >Operations to perform: > > Apply all migrations: admin, auth, sessions, contenttypes, quedar > >Running migrations: > >Applying quedar.0003_auto_20150322_1813...Traceback (most recent call > >last > >): > >File "/usr/lib/python3.4/site-packages/django/apps/config.py", line > >163, > >in get_model > > return self.models[model_name.lower()] > >KeyError: 'user' > > > >During handling of the above exception, another exception occurred: > > > >Traceback (most recent call last): > >File "/usr/lib/python3.4/site-packages/django/db/migrations/state.py", > >line 84, in render > > model = self.apps.get_model(lookup_model[0], lookup_model[1]) > >File "/usr/lib/python3.4/site-packages/django/apps/registry.py", line > >202, > >in get_model > > return self.get_app_config(app_label).get_model(model_name.lower()) > >File "/usr/lib/python3.4/site-packages/django/apps/config.py", line > >166, > >in get_model > > "App '%s' doesn't have a '%s' model." % (self.label, model_name)) > >LookupError: App 'quedar' doesn't have a 'user' model. > > > >During handling of the above exception, another exception occurred: > > > >Traceback (most recent call last): > > File "manage.py", line 10, in <module> > > execute_from_command_line(sys.argv) > > File > >"/usr/lib/python3.4/site-packages/django/core/management/__init__.py", > >line > >385, in execute_from_command_line > > utility.execute() > > File > >"/usr/lib/python3.4/site-packages/django/core/management/__init__.py", > >line > >377, in execute > > self.fetch_command(subcommand).run_from_argv(self.argv) > >File "/usr/lib/python3.4/site-packages/django/core/management/base.py", > > > >line 288, in run_from_argv > > self.execute(*args, **options.__dict__) > >File "/usr/lib/python3.4/site-packages/django/core/management/base.py", > > > >line 338, in execute > > output = self.handle(*args, **options) > > File > > >"/usr/lib/python3.4/site-packages/django/core/management/commands/migrate.py", > > > >line 161, in handle > > executor.migrate(targets, plan, fake=options.get("fake", False)) > >File > >"/usr/lib/python3.4/site-packages/django/db/migrations/executor.py", > >line 68, in migrate > > self.apply_migration(migration, fake=fake) > >File > >"/usr/lib/python3.4/site-packages/django/db/migrations/executor.py", > >line 102, in apply_migration > > migration.apply(project_state, schema_editor) > > File > >"/usr/lib/python3.4/site-packages/django/db/migrations/migration.py", > >line > >108, in apply > > operation.database_forwards(self.app_label, schema_editor, > >project_state, new_state) > > File > > >"/usr/lib/python3.4/site-packages/django/db/migrations/operations/fields.py", > > > >line 29, in database_forwards > > to_model = to_state.render().get_model(app_label, self.model_name) > >File "/usr/lib/python3.4/site-packages/django/db/migrations/state.py", > >line 94, in render > >raise ValueError(msg.format(field=operations[0][1], > >model=lookup_model)) > >ValueError: Lookup failed for model referenced by field > >quedar.LearningGroup.members: quedar.User > >[xan@mercuri gargamella]$ > > > > > > > >Any hints? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/97C9627D-9E65-4943-8BD7-6069E3288383%40markusholtermann.eu > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW3VsHHq2gsdWLx_UcUwDnrQ95MuYkyJVbcq0SqW_8YEA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.