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