首页 > 其他 > 详细

Import error in Django

时间:2016-03-10 23:41:28      阅读:398      评论:0      收藏:0      [点我收藏+]

when i try to give the environment variable "DJANGO_SETTINGS_MODULE" a path, for example, 

DJANGO_SETTINGS_MODULE=mysite_settings,

DJANGO_SETTINGS_MODULE=/home/wgz/my_project/mysite/mysite.settings,

then i type the command "python3 manage.py shell", a "ImportError: No module named ‘/home/wgz/my_project/" comes up.

after seaching some materials, i got a method by typing "os.environ[‘DJANGO_SETTINGS_MODULES‘]=‘mysite.settings‘", then the "ImportError" disappear. of course, this is in the Python environment and import os in advance.

 

Import error in Django

原文:http://www.cnblogs.com/bajunma123/p/5263932.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!