简体   繁体   English

没有名为urls的模块的Python-Django ImportError

[英]Python-Django ImportError at No module named urls

I have created Djnago project in digitalocean 我已经在digitalocean中创建了Djnago项目

. Unfortunately, i am facing issue when i run the project 不幸的是,我在运行项目时遇到了问题

ImportError at / No module named urls ImportError at /没有名为URL的模块

http://www.btcdoller.com/ http://www.btcdoller.com/

digitalocean 数字海洋

https://django-registration-redux.readthedocs.io https://django-registration-redux.readthedocs.io

pip install django-registration-redux  

file settings.py add 文件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.

file urls.py add 文件urls.py添加

url(r'^accounts/', include('registration.backends.default.urls')),

Not sure that it is django-registration-redux causing this error. 不确定是django-registration-redux导致此错误。 The stack trace shows you are getting an error on the following line in your urls.py file: 堆栈跟踪显示您在urls.py文件的以下行上遇到错误:

from django.urls import path 

It may be that you have not configured your environment correctly on the digital ocean server that you are hosting on. 可能是您没有在托管的数字海洋服务器上正确配置环境。 Make sure you have done a pip install on all the requirements, including pip install django 请确保你做了pip install的所有要求,包括pip install django

Can you check your ROOT_URLCONF in your settings.py file it has to be 您可以在settings.py文件中检查ROOT_URLCONF吗?

ROOT_URLCONF = 'yoursite.urls'

sorry but I cant write comments yet! 抱歉,我还不能发表评论!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM