Thanks for the info. At least I now know it wasn't anything I was doing wrong!
On Monday, 28 April 2014 17:54:29 UTC+1, Simon Charette wrote:
-- On Monday, 28 April 2014 17:54:29 UTC+1, Simon Charette wrote:
This is a release blocker for Django 1.7 which is being tracked in #22485.
Le lundi 28 avril 2014 04:54:32 UTC-4, Ryan a écrit :I have used django in the past, but not for some time. So the changes surrounding the user models are new to me. I downloaded v1.7b2 and proceeded to start a new development I am planning. However I came across a problem when trying to run migrate after generating the migrations on an app that has a model that contains a foreign key to the user model. So I created a simple test app to isolate the problem, with a model defined as below:from django.db import modelsfrom django.conf import settingsclass TestModel(models.Model):user = models.ForeignKey(settings.AUTH_USER_MODEL) When I run "makemigrations test_app" the migrations seem to be created fine as there are no errors produced. However when I run "migrate" I get the folllowing errors:C:\Users\osborn_r\django\test_project>python manage.py migrate Operations to perform:Synchronize unmigrated apps: admin, contenttypes, auth, sessionsApply all migrations: test_app, authSynchronizing apps without migrations:Creating tables...Installing custom SQL...Installing indexes...Running migrations:Applying test_app.0001_initial...Traceback (most recent call last): File "manage.py", line 10, in <module>execute_from_command_line(sys.argv) File "C:\Python27\lib\site-packages\django\core\ management\__init__.py", line 427, in execute_from_command_lineutility.execute()File "C:\Python27\lib\site-packages\django\core\ management\__init__.py", line 419, in executeself.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Python27\lib\site-packages\django\core\ management\base.py", line 288, in run_from_argvself.execute(*args, **options.__dict__)File "C:\Python27\lib\site-packages\django\core\ management\base.py", line 337, in executeoutput = self.handle(*args, **options)File "C:\Python27\lib\site-packages\django\core\ management\commands\migrate.py ", line 145, in handleexecutor.migrate(targets, plan, fake=options.get("fake", False))File "C:\Python27\lib\site-packages\django\db\migrations\ executor.py", line 60 , in migrateself.apply_migration(migration, fake=fake) File "C:\Python27\lib\site-packages\django\db\migrations\ executor.py", line 88 , in apply_migrationif self.detect_soft_applied(migration): File "C:\Python27\lib\site-packages\django\db\migrations\ executor.py", line 13 2, in detect_soft_appliedapps = project_state.render()File "C:\Python27\lib\site-packages\django\db\migrations\ state.py", line 63, i n rendermodel=dangling_lookup[0]))ValueError: Lookup failed for model referenced by field auth.Permission.content_type: contenttypes.ContentTypeCan anyone spot what I have done wrong?
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+unsubscribe@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/d3b85387-1c06-4f48-876c-0f6a75bbb4d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment