python dashboard django_django导入错误:没有名为“dashboard”的模块

我正在尝试使用python3.4在django1.9中运行我自己的仪表板。在主项目应用程序中网址.py我试图包含网址.py从我的新仪表板应用程序文件。在

目录结构venv/

pic/

docs/

(developer notes, deployment notes, etc)

pic/

__init__.py

manage.py

test.py

apps/

__init__.py

dasboard/

migrations/

static/

__init__.py

admin.py

apps.py

models.py

test.py

urls.py

views.py

core/

(other stuff unrelated to issue)

pic/

media/

settings/

static/

__init__.py

urls.py

wsgi.py

相关文件

pic/pic/pic/网址.py

^{pr2}$

pic/pic/apps/仪表板/网址.pyfrom django.conf.urls import url

from pic.apps.dashboard import views

urlpatterns = [

url(r'^$', views.index, name='index'),

]

pic/pic/apps/仪表板/视图.pyfrom django.http import HttpResponse

# Create your dashboard views here.

def index(request):

return HttpResponse("Hello, world. You're at the dashboard index.")

pic/pic/pic/设置/基准.py(选定相关件)INSTALLED_APPS = [

'django.contrib.admin',

'django.contrib.auth',

'django.contrib.contenttypes',

'django.contrib.sessions',

'django.contrib.messages',

'django.contrib.staticfiles',

'apps.core',

'apps.dashboard',

]

ROOT_URLCONF = 'pic.urls'

访问/dashboard/时收到错误

ImportError at /dashboard/

No module named 'dashboard'

Request Method: GET

Request URL: http://dev.pic.com/dashboard/

Django Version: 1.9.6

Exception Type: ImportError

Exception Value:

No module named 'dashboard'

Exception Location: /home//Repositories/Websites/pic/venv/lib/python3.4/importlib/__init__.py in import_module, line 109

Python Executable: /home//Repositories/Websites/pic/venv/bin/uwsgi

Python Version: 3.4.3

Python Path:

['.',

'',

'/home//Repositories/Websites/pic/venv/lib/python3.4',

'/home//Repositories/Websites/pic/venv/lib/python3.4/plat-x86_64-linux-gnu',

'/home//Repositories/Websites/pic/venv/lib/python3.4/lib-dynload',

'/usr/lib/python3.4',

'/usr/lib/python3.4/plat-x86_64-linux-gnu',

'/home//Repositories/Websites/pic/venv/lib/python3.4/site-packages']

Server time: Sun, 26 Jun 2016 14:49:07 -0700

注释

127.0.0.1/admin/正常工作并加载管理员登录名。我知道那很好。

当我试图访问127.0.0.1/dashboard/时,收到上面提到的错误。在

使用django shell时,我可以成功地完成from apps import dashboard。dashboard.models返回正确的输出,但是dashboard.urls抛出一个“Attribute Error:'module”对象没有属性“url”。不知道这些额外的信息是否有用,但我认为这是奇怪的行为。在尝试调试此问题时发现它。在

背景

我熟悉django的老版本,因为我已经维护了大约5个月的1.7项目。我的python经验并不丰富,但我目前靠这样做为生。不过,我仍然经常学习django和python。在

感谢您抽出时间来回顾我的问题。我本希望不必在这里发帖,但4个小时后我还是没有任何进展。我希望在你的帮助下我能搞定这件事!在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值