[英]Python-Django ImportError at No module named urls
我已经在digitalocean中创建了Djnago项目
。 不幸的是,我在运行项目时遇到了问题
ImportError at /没有名为URL的模块
数字海洋
https://django-registration-redux.readthedocs.io
pip install django-registration-redux
文件settings.py添加
INSTALLED_APPS = (
'django.contrib.sites',
'registration', #should be immediately above 'django.contrib.admin'
'django.contrib.admin',
# ...other installed applications...
)
ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
REGISTRATION_AUTO_LOGIN = True # Automatically log the user in.
文件urls.py添加
url(r'^accounts/', include('registration.backends.default.urls')),
不确定是django-registration-redux
导致此错误。 堆栈跟踪显示您在urls.py
文件的以下行上遇到错误:
from django.urls import path
可能是您没有在托管的数字海洋服务器上正确配置环境。 请确保你做了pip install
的所有要求,包括pip install django
您可以在settings.py文件中检查ROOT_URLCONF吗?
ROOT_URLCONF = 'yoursite.urls'
抱歉,我还不能发表评论!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.