How to solve import errors while trying to deploy Flask using WSGI on Apache2

后端 未结 2 1168
小蘑菇
小蘑菇 2020-12-13 18:09

I am having an issue deploying a flask app on apache2 using wsgi. I have posted the error logs and config files below. I have tried moving things around, renaming them, etc,

2条回答
  •  死守一世寂寞
    2020-12-13 18:43

    Thanks to zarf and damjan on irc.freenode.org at #pocoo, they were able to help me get this fixed. The problem was the PythonPath was not correct. We fixed this by using the following wsgi.py

    import sys
    sys.path.insert(0, "/sites/flaskfirst")
    
    from app import app
    application = app
    

提交回复
热议问题