django无法启动runserver

时间:2014-08-30 09:48:47

标签: django mongodb

无法启动C:\ Python27 \ mysastha> python manage.py runserver     C:\ python27 \ LIB \站点包\ djangotoolbox-1.6.2-py2.7.egg \ djangotoolbox \ DB \ UTI     ls.py:5:RemovedInDjango19Warning:django.utils.unittest将在Djan中删除     去1.9。       来自django.utils.unittest import skip

Traceback (most recent call last):
  File "manage.py", line 17, in <module>
    execute_from_command_line(sys.argv)
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\core\managemen
t\__init__.py", line 330, in execute_from_command_line
    utility.execute()
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\core\managemen
t\__init__.py", line 304, in execute
    django.setup()
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\__init__.py",
line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\apps\registry.
py", line 108, in populate
    app_config.import_models(all_models)
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\apps\config.py
", line 197, in import_models
    self.models_module = import_module(models_module_name)
  File "c:\python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\contrib\auth\m
odels.py", line 40, in <module>
    class Permission(models.Model):
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\db\models\base
.py", line 127, in __new__
    new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\db\models\base
.py", line 303, in add_to_class
    value.contribute_to_class(cls, name)
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\db\models\opti
ons.py", line 166, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length(
))
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\db\__init__.py
", line 36, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\db\utils.py",
line 238, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "c:\python27\lib\site-packages\django-1.8-py2.7.egg\django\db\utils.py",
line 127, in load_backend
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django_mongodb_engine' isn't an av
ailable database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    u'django_mongodb_engine', u'mysql', u'oracle', u'postgresql_psycopg2', u'sql
ite3'
Error was: cannot import name decimal_to_string

1 个答案:

答案 0 :(得分:0)

只需按照追溯中的说明操作即可。你需要django.db.backends.django_mongodb_engine作为引擎。不只是django_mongodb_engine.

如果您还没有,您可能需要一些依赖项才能使引擎正常工作。我在移动设备上,并不知道他们现在被称为mongodb