Operations to perform:
Synchronize unmigrated apps: google, staticfiles, twitter, messages, reflect, allauth, facebook, rest_framework, crispy_forms
Apply all migrations: account, django_comments, links, sessions, admin, fluent_comments, sites, auth, contenttypes, socialaccount
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
No migrations to apply.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Home\venv\lib\site-packages\django\core\management\__init__.py", line 338, in execute_from_command_line
utility.execute()
File "C:\Users\Home\venv\lib\site-packages\django\core\management\__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Home\venv\lib\site-packages\django\core\management\base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Home\venv\lib\site-packages\django\core\management\base.py", line 441, in execute
output = self.handle(*args, **options)
File "C:\Users\Home\venv\lib\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 "C:\Users\Home\venv\lib\site-packages\django\core\management\sql.py", line 280, in emit_post_migrate_signal
using=db)
File "C:\Users\Home\venv\lib\site-packages\django\dispatch\dispatcher.py", line 201, in send
response = receiver(signal=self, sender=sender, **named)
File "C:\Users\Home\venv\lib\site-packages\django\contrib\auth\management\__init__.py", line 82, in create_permissions
ctype = ContentType.objects.db_manager(using).get_for_model(klass)
File "C:\Users\Home\venv\lib\site-packages\django\contrib\contenttypes\models.py", line 78, in get_for_model
"Error creating new content types. Please make sure contenttypes "
RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.
Ho provato a cancellare il db e makemigrations
e poi migrate
. Stesso erroreRuntimeError: errore la creazione di nuovi tipi di contenuto
Quindi ho provato migrate contenttypes
prima di migrate
. Nessuna modifica nel traceback.
Cosa c'è che non va?
sto usando django == 1.8
Prova 'python manage.py migrate contenttypes --fake'. –
Errore ripetuto :( – StackExchange
Il campo 'ContentType.name' è stato deprecato in Django 1.8 Un'altra opzione che puoi provare a rimuovere la colonna' nome', ad esempio 'ALTER TABLE django_content_type DROP COLUMN name'. –