在运行python manage.py时出现此类型的错误

时间:2018-09-28 05:49:52

标签: python django

在运行manage.py时不推荐使用django.db.backend。该站点程序包不支持

home/devbase/env/local/lib/python2.7/site-packages/django/utils/functional.py:55: RemovedInDjango18Warning: Accessing django.db.backend is deprecated.
  res = instance.__dict__[self.func.__name__] = self.func(instance)

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/config.py", line 197, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/devbase/devbase/queuearoo/main/models.py", line 7, in <module>
    from django_earthdistance.expressions import DistanceExpression
ImportError: No module named django_earthdistance.expressions

1 个答案:

答案 0 :(得分:1)

模块django_earthdistance.expressions是软件包django-earthdistance的一部分,该软件包似乎尚未安装,请运行

pip install django-earthdistance

安装。