【发布时间】:2016-07-03 22:29:00
【问题描述】:
我正在使用一个相当便宜的共享主机帐户尝试使用 http://fgimian.github.io/blog/2014/02/14/serving-a-python-flask-website-on-hostmonster 部署烧瓶应用程序。我已将代码和 fcgi 脚本放在 ~/domains/mini 中
fcgi 脚本是:
#!/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()
我已经到了最后一步,并在命令行中对其进行了测试:
[~/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>.
托管公司没有帮我解决这个问题。对下一步做什么有什么想法吗?
【问题讨论】:
-
为什么路径前有波浪线?
-
我尝试了几种不同的方法,但始终获得相同的输出。也试过 /domains/mini