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