Heroku gunicorn deploy error: NoModuleNameError

前端 未结 2 667
醉酒成梦
醉酒成梦 2020-12-21 12:36

possibly a little out my depth here, I\'ve read the heroku docs thoroughly and still don\'t quite understand how the Procfile should be set up. Trying to deploy heroku (

相关标签:
2条回答
  • 2020-12-21 12:52

    try updating your Procfile to read as:

    web: gunicorn grad.wsgi --log-file - --log-level debug --preload --workers 1
    

    I have a few Heroku-Django apps that works with a similar setup. Let me know if it works for you?

    0 讨论(0)
  • 2020-12-21 13:10

    You correctly identified that the key line in the error message is the ModuleNotFoundError.

    2020-01-27T11:39:57.599554+00:00 app[web.1]: ModuleNotFoundError: No module named 'grad'
    

    The problem is that your Django project directory (the one containing manage.py) isn't in the project root, it's in the gpproject directory.

    Therefore you need to add that directory to the Python path with the --python flag, so that the grad module inside it can be imported.

    web: gunicorn grad.wsgi:application --python gpproject --log-file - --log-level debug --preload --workers 1
    
    0 讨论(0)
提交回复
热议问题