Ho installato la sandbox per app di django-oscar sul mio sito Web all'indirizzo example.com. volevo spostarlo su example.com:8000 ed eseguire un altro progetto all'indirizzo example.com. Ho eseguito con successo la seconda parte e quando entri in example.com, puoi vedere il nuovo progetto django attivo e funzionante, ma il fatto è che il primo progetto di django che era la sandbox di django-oscar non risponderà correttamente.nessuna colonna: django_content_type.name
quando si entra example.com:8000, si vede l'attuale registro di debug:
no such column: django_content_type.name
Request Method: GET
Request URL: http://example.com:8000/fa/
Django Version: 1.7.8
Exception Type: OperationalError
Exception Value:
no such column: django_content_type.name
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py in execute, line 485
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/var/www/setak/setakenv/setakmain/django-oscar/sites/sandbox',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-couch',
'/usr/lib/python2.7/dist-packages/ubuntuone-installer',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
ora I Googled questo errore e non ho ottenuto alcun risultato di valore.
Inoltre, quando corro
sudo python manage.py migrate
accade quanto segue, che pure non ho trovato alcuna risoluzione corretta per risolvere:
Operations to perform:
Synchronize unmigrated apps: reports_dashboard, treebeard, oscar, communications_dashboard, reviews_dashboard, debug_toolbar, widget_tweaks, offers_dashboard, catalogue_dashboard, sitemaps, compressor, django_extensions, dashboard, thumbnail, haystack, ranges_dashboard, checkout, gateway, django_tables2
Apply all migrations: customer, promotions, shipping, wishlists, offer, admin, sessions, contenttypes, auth, payment, reviews, analytics, catalogue, flatpages, sites, address, basket, partner, order, voucher
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
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 "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 165, in handle
emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 268, in emit_post_migrate_signal
using=db)
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 198, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py", line 83, in create_permissions
ctype = ContentType.objects.db_manager(using).get_for_model(klass)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/models.py", line 58, in get_for_model
" is migrated before trying to migrate apps individually."
RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.
aggiornamento 1: Sono anche utilizzando Django 1.7.8 per questo.
aggiornamento 2: Ho modificato la mia versione di Django a 1.8.1, i comandi makemigrations e migrate hanno funzionato. Poi ho eseguito il server di nuovo, e ora ottengo questo errore nel mio ceppo: (ho anche cancellato le impostazioni di Apache in quanto erano irrilevanti!)
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
return self.application(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 170, in __call__
self.load_middleware()
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 50, in load_middleware
mw_class = import_string(middleware_path)
File "/usr/local/lib/python2.7/dist-packages/django/utils/module_loading.py", line 26, in import_string
module = import_module(module_path)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named transaction
Hai provato ciò che Django sta suggerendo e migrare ContentTypes prima? –
@ ger.s.brett sì, l'ho fatto. lo stesso errore accade! –
Hai iniziato con django 1.8 e successivamente esegui il downgrade a django 1.7.8? – karthikr