Import error in Django

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Import error in Django相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Error in import M2Crypto 解决方案

screenshot() 给出:ImportError: cannot import name glReadPixels error in kivy

mysql ERROR 1071 (Specified key was too long; max key length is 1000 bytes) in simple dump-import se

error in ./node_modules/cesium/Source/ThirdParty/zip.js

error in ./node_modules/cesium/Source/ThirdParty/zip.js

Sqoop 导入错误 Error: java.io.IOException: SQLException in nextKeyValue