python - 将 Flask 应用程序部署到托管在 godaddy

标签 python

我正在使用 Python/Flask 微框架。 ( http://flask.pocoo.org/ ) 构建一个小型应用程序。在本地测试应用程序并将其部署到 godaddy,然后在转到 URL 时看到“ERROR 400”。我调用他们的技术支持,他们说该应用程序需要 index.html 页面,而且他们的平台不支持 python。这是我加载页面的位置。

mAIN.PY

仅供引用,它在 Amazon EC2 中运行。

最佳答案

处于共享环境中意味着您很可能需要使用 CGI 进行部署:

http://flask.pocoo.org/docs/deploying/cgi/

On shared webhosting, though, you might not have access to your Apache config. In this case, a file called .htaccess, sitting in the public directory you want your app to be available, works too but the ScriptAlias directive won’t work in that case:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f # Don't interfere with static files RewriteRule ^(.*)$ /path/to/the/application.cgi/$1 [L]

关于python - 将 Flask 应用程序部署到托管在 godaddy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17112805/

相关文章:

python - setFont(Times-Roman) 不能缺少 T1 文件吗?

Python 函数不调用 __init__

python - Numpy 似乎产生了不正确的特征向量

python - 可视化使用 pandas 数据框创建的二分网络图

Python3 子进程在旧 shell 中执行命令 - sftp 问题

python - 通过在 Python 中的特定字符上拆分字符串来选择 csv 文件中的行

python - 有没有办法接受参数选择作为单个字符串

python - git graph父子表格格式

python - Python 计算器最少击键次数问题

python - pandas - 从列中提取大于阈值的值