gpt4 book ai didi

python - 运行时出现错误 "python manage.py check"

转载 作者:行者123 更新时间:2023-12-01 07:53:13 24 4
gpt4 key购买 nike

自从我开始工作以来,我一直无法在本地运行我的网络应用程序。我已经这样做了一段时间,但仍然无法获得干净的 python manage.py runserverpython manage.py check

我曾经在这里安装过 Anaconda,这会影响我的路径吗?

这是我收到的错误。

(venv) BattleStationOnline 10:13:51 aggrigator$~python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/anaconda2/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/anaconda2/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/anaconda2/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/anaconda2/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/anaconda2/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/anaconda2/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/andynguyen/Desktop/aggrigator/aggrigator/accounts/models.py", line 21, in <module>
from simple_history.models import HistoricalRecords
File "/anaconda2/lib/python2.7/site-packages/simple_history/models.py", line 18, in <module>
from django.urls import reverse
ImportError: No module named urls

编辑:我正在运行 Django 1.8,并且我的 web 应用程序在我的 ubuntu 服务器上运行正常。

最佳答案

Django:1.8 doc for reverse()

使用,

from django.core.urlresolvers import reverse
<小时/>

其他信息

django.core.urlresolvers.reverse
Deprecated since version 1.10:In older versions, these functions are located in django.core.urlresolvers. Importing from the old location will continue to work until Django 2.0.

关于python - 运行时出现错误 "python manage.py check",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56096446/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com