项目已经写好,但不了解如何部署到服务器,求哪位朋友帮忙指导下,如果有这方面的教程或者博客就太好了

1 tvallday Apr 1, 2016 根据我的经验,你需要一个 web server ,还要有反向代理 Nginx ,你也可以不用 Nginx ,但是现在这么流行学学也没坏处。 web server 我用的是 Unicorn. 在 Google 上搜 Gunicorn flask server 。你就能找到答案。 |
2 tvallday Apr 1, 2016 写错,应该是 Gunicorn 不是 Unicorn , Unicorn 是 Ruby 的 server 。还有其他的 server 你也可以看一下。当然你最好把 Gunicorn 启动加到 system service 里面去,然后你就可以 sudo systemctl gunicorn start 启动了。当然添加 system service 也有很多种办法, GoogleForWhatYouWant. |
3 csdreamdong Apr 1, 2016 apache + mod_wsgi |
5 biexiawo OP @csdreamdong 官方文档就是推荐的这种方法,但其介绍的太简略 |
6 Kilerd Apr 1, 2016 nginx uwign/gunicorn gevent superivor 一套搞定。 |
8 aiver Apr 1, 2016 一般是 Nginx + Gunicorn + Supervisor + Flask 部署,这里有一个在阿里云上部署的例子,你可以参考: http://www.simpleapples.com/2015/06/configure-nginx-supervisor-gunicorn-flask/,我之前也是在阿里云上部署的 |
9 clino Apr 1, 2016 uwsgi 也很不错,跟 nginx 配合起来用 |
10 lhbc Apr 1, 2016 via Android uwsgi, 搜索一下就有文档,非常简单。 uwsgi 是多进程的,简单成熟。 |
11 yjd Apr 1, 2016 重点是安全,不然就等着被 xx 了。 |
12 crazyxin1988 Apr 1, 2016 virtualenv+supervisor+nginx+gunicorn |
13 strahe Apr 1, 2016 搜一下 uwsgi + nginx 教程很多. |
14 wellsc Apr 1, 2016 官方文档和《 flask web 开发》不是教了你 N 种方法吗?伸手就行了 |
15 biexiawo OP @crazyxin1988 部署好了,用你的这个方法, 3Q ! |
18 biexiawo OP @csdreamdong 谢谢! |
20 Abirdcfly Apr 2, 2016 给一个新浪云 SAE 部署的例子: http://abirdcfly.github.io/2016/03/07/flask-to-sae/ |
21 KgM4gLtF0shViDH3 Apr 2, 2016 via iPhone youtube 搜 flask tutorial 就有了,一步一步教的。那小伙的教程都不错。 |
23 zwzmzd Apr 2, 2016 via Android 一般来讲 uwsgi 就够了。 以下是我生产环境的配置,供参考 uwsgi --http ":8080" --wsgi-file index.uwsgi --master --processes=5 --uid nobody --listen 5000 --static-map /static=static/ |
24 clockwerk Apr 2, 2016 via iPhone 用 python3 开发的,正在 ngnix gunicorn ,但是卡在 python3 不支持 supervisor 上了 |
25 zvDC Apr 2, 2016 嗯,还在看 flask web |
27 struggling Jan 6, 2017 请问你们有用 Windows 部署成功的吗?感觉 Windows 好多坑。。 |
28 geek123 Mar 12, 2018 |
29 gevin Jul 26, 2018 |