我在digitalocean中创建了Djnago项目
。不幸的是,我在运行项目时面临问题
ImportError at / No module named urls
digitalocean
https://django-registration-redux.readthedocs.io
pip install django-registration-redux
file settings.py add
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 add
url(r'^accounts/', include('registration.backends.default.urls')),
答案 0 :(得分:0)
不确定是django-registration-redux
导致此错误。堆栈跟踪显示您在urls.py
文件中的以下行收到错误:
from django.urls import path
您可能未在您托管的数字海洋服务器上正确配置环境。确保您已完成pip install
所有要求,包括pip install django
答案 1 :(得分:0)
你能在你的settings.py文件中查看你的ROOT_URLCONF吗
ROOT_URLCONF = 'yoursite.urls'
抱歉,但我还不能写评论!