簡體   English   中英

沒有名為urls的模塊的Python-Django ImportError

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

我已經在digitalocean中創建了Djnago項目

不幸的是,我在運行項目時遇到了問題

ImportError at /沒有名為URL的模塊

http://www.btcdoller.com/

數字海洋

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM