WSGI Script Cannot Be Loaded as Python Module — 500 Internal Server Error

后端 未结 1 1734
误落风尘
误落风尘 2020-12-20 05:48

According to my error log, my Target WSGI Script cannot be loaded as a Python module, but at the end of my log, I also get an ImportError: No module named foodshop.setti

相关标签:
1条回答
  • 2020-12-20 05:55

    You haven't done anything to put your app - and its settings file - on your Python path.

    If you're not using a virtualenv (though you should be), the simplest thing to do would be to do in your wsgi file:

    import os, sys
    sys.path.append('/home/ubuntu/gather/src')
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "foodshop.settings")
    
    0 讨论(0)
提交回复
热议问题