我在我的 python(2.7) 项目中使用 mongodb 和 django 框架..当我给 python manage.py runserver 它会工作但是如果我同步 db (python manage.py syncdb) 终端中显示以下错误
Creating tables ...
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/lib/pymodules/python2.7/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/lib/pymodules/python2.7/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/pymodules/python2.7/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/pymodules/python2.7/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/lib/pymodules/python2.7/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/lib/pymodules/python2.7/django/core/management/commands/syncdb.py", line 109, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/lib/pymodules/python2.7/django/core/management/sql.py", line 190, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/lib/pymodules/python2.7/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/lib/pymodules/python2.7/django/contrib/auth/management/__init__.py", line 41, in create_permissions
"content_type", "codename"
File "/usr/lib/pymodules/python2.7/django/db/models/query.py", line 107, in _result_iter
self._fill_cache()
File "/usr/lib/pymodules/python2.7/django/db/models/query.py", line 772, in _fill_cache
self._result_cache.append(self._iter.next())
File "/usr/lib/pymodules/python2.7/django/db/models/query.py", line 959, in iterator
for row in self.query.get_compiler(self.db).results_iter():
File "/usr/local/lib/python2.7/dist-packages/djangotoolbox/db/basecompiler.py", line 229, in results_iter
for entity in self.build_query(fields).fetch(low_mark, high_mark):
File "/usr/local/lib/python2.7/dist-packages/djangotoolbox/db/basecompiler.py", line 290, in build_query
query.order_by(self._get_ordering())
File "/usr/local/lib/python2.7/dist-packages/djangotoolbox/db/basecompiler.py", line 339, in _get_ordering
raise DatabaseError("Ordering can't span tables on non-relational backends (%s)" % order)
和
django.db.utils.DatabaseError: Ordering can't span tables on non-relational backends (content_type__app_label)
如何解决这个问题呢?