Ich versuche, von Django 1.6
zu Django 1.8
zu migrieren. Ich benutzte South
für die Verwaltung migrations
in Django 1.6. Ich habe erfolgreich neue Migrationsdateien von python manage.py makemigrations
erstellt. während python manage.py migrate --fake-initial
läuft, ich diesen FehlerFehler beim Erstellen neuer Inhaltstypen. Stellen Sie sicher, dass contenttypes migriert wird, bevor Sie versuchen, Apps einzeln zu migrieren.
Traceback (most recent call last):
File "manage.py", line 39, in <module>
execute_from_command_line(sys.argv)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site- packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site- packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 225, in handle
emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/core/management/sql.py", line 280, in emit_post_migrate_signal
using=db)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 201, in send
response = receiver(signal=self, sender=sender, **named)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py", line 82, in create_permissions
ctype = ContentType.objects.db_manager(using).get_for_model(klass)
File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 78, in get_for_model
"Error creating new content types. Please make sure contenttypes "
Einer der Migrationsdatei 0001_initial.py
sagt immer bin:
dependencies = [
('auth', '0006_require_contenttypes_0002'),
('clients', '0002_auto_20150428_1551'),
('players', '0001_initial'),
]
die ich schätze, ist vor allem das Problem. Was könnte die Problemumgehung dieses Problems sein? Jede Hilfe wird geschätzt.
Die Abhängigkeit von Auth 0006 sollte sicherstellen, dass 'contenttypes' migriert wird, bevor die nach der Migration Signal ausgeführt wird. Was ist der Fehler, wenn Sie 'ContentType.objects.get manuell ausführen (app_label =, modelname = )'? –
knbk
'ContentType passende Abfrage existiert nicht' – Shubham
Und mit' get_or_create() '? – knbk