根据我的经验,你需要一个 web server ,还要有反向代理 Nginx ,你也可以不用 Nginx ,但是现在这么流行学学也没坏处。 web server 我用的是 Unicorn. 在 Google 上搜 Gunicorn flask server 。你就能找到答案。
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.