开发者

Import error in django settings . How to remove the error?

开发者 https://www.devze.com 2023-03-14 11:37 出处:网络
ImportError: Could not import settings \'file-patn/sett开发者_如何学Cings\' (Is it on sys.path?): Import by filename is not supported.
ImportError: Could not import settings 'file-patn/sett开发者_如何学Cings' (Is it on sys.path?): Import by filename is not supported.

My code has this

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

What changes need to be done in the code to remove the error ?


Just add this:

os.environ['DJANGO_SETTINGS_MODULE'] = 'application_path.settings'


Could it be that, you wanted to specify the Python import like:

file-patn.settings

instead?

0

精彩评论

暂无评论...
验证码 换一张
取 消