I'm working with a rather cheap shared hosting account trying to deploy a flask app using http://fgimian.github.io/blog/2014/02/14/serving-a-python-flask-website-on-hostmonster . I've put the code and the fcgi script in ~/domains/mini
The fcgi script is:
#!/home/username/anaconda2/bin/python
import sys,os
from flup.server.fcgi import WSGIServer
sys.path.insert(0, '/username/domains/mini')
from myflaskapp.settings import Config, SharedConfig
from myflaskapp.app import create_app
if __name__ == '__main__':
app = create_app(SharedConfig)
WSGIServer(app).run()
I've gotten to the last step and while testing it at the command line:
[~/domains/mini]# ./mini.fcgi
....
Status: 301 MOVED PERMANENTLY
Content-Type: text/html; charset=utf-8
Content-Length: 241
Location: http://localhost/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="http://localhost/">http://localhost/</a>.
The hosting company is not helping me with this. Any thoughts on what to do next ?
I recently encountered the same problem and managed to solve it by downgrading my Werkzeug package
pip install Werkzeug==0.9.6
It's not clear to me why this helped but it seems that the my version of Werkzeug (0.11.10) was incompatible with Flask (0.11.1).