why does this exception "Django ImportError at / No module named jiong.urls" occured?

2012-07-30 14:45:25 +08:00
 stackpop
No module named jiong.urls

Request Method: GET
Request URL: http://localhost/
Django Version: 1.4
Exception Type: ImportError
Exception Value:

No module named jiong.urls

Exception Location: /opt/server/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /opt/server/bin/uwsgi
Python Version: 2.7.3
Python Path:

['/opt/server/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/opt/server/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/opt/server/lib/python2.7',
'/var/www/jiong/jiong',
'/opt/python/lib/python27.zip',
'/opt/python/lib/python2.7',
'/opt/python/lib/python2.7/plat-linux2',
'/opt/python/lib/python2.7/lib-tk',
'/opt/python/lib/python2.7/lib-old',
'/opt/python/lib/python2.7/lib-dynload',
'/opt/python/lib/python2.7/site-packages',
'/opt/server/lib/python2.7/site-packages']

Server time: Mon, 30 Jul 2012 01:35:17 -0500
--------------------------------------------------

I just use nginx and uwsgi run django app, but this error occured, can someone help me solve it.

The following are steps I configure the django server:

1.compile and install python 2.7 with source code

2.install python-setuptools

3.then easy_install pip and virtualenv

4. create a virtual env use virtualenv server and let the python path as the previous compiled 2.7 version

5.activate the virtual enviroment. and then pip install uwsgi and django

6.run django-admin.py startprojects to add a new project called "jiong"
the new django 1.4 will generate a default wsgi.py file

6.edit nginx.conf and add a server item, then restart nginx

7. run uwsgi -s :9090 -M -p 4 -d /var/www/dddd2.log --vhost
2956 次点击
所在节点    Python
2 条回复
stackpop
2012-07-30 15:01:31 +08:00
thx for all.
I just changed the jiong.urls in settings.py into urls, then it works.

can someone tell me the relationships between django projects and apps.
cloudzhou
2012-07-30 15:15:31 +08:00
django projects and apps 无非就是python的packages,在uwsgi能访问得到

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/43852

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX