python - 如何在Windows server上部署flask
ringa_lee
ringa_lee 2017-04-17 17:52:55
0
3
489

用flask写了一个天气预报查询网站,在本地可以运行,但是放在github上的gh-pages上不能正常显示,所以就想着放到服务器上,所以就买了个腾讯云服务器,但是不知道该怎么配置,网上也查了很久,感觉都是Linux。个人没用过Linux,如果用Linux感觉又要学好多东西,所以想问一下有什么办法可以配置Windows server的办法,最好是腾讯云服务器的配置方法。谢谢了!

ringa_lee
ringa_lee

ringa_lee

reply all (3)
黄舟

It is generally deployed in the form of Flask+uWSGI+Nginx under Linux. It is really troublesome to deploy under win. I don’t know what your website is used for. If it is not a large-scale formal application, you can use tornado-server to deploy it. The specific method is very simple. In your flask project, the original entry program is assumed to be the tornado application tornado_server.py added to the same level directory of run.py. The content is as follows:

#coding=utf-8 from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from run import app http_server = HTTPServer(WSGIContainer(app)) http_server.listen(9000) #flask默认的端口 IOLoop.instance().start()
    Peter_Zhu

    1. Personally, you can deploy it as an apache service.

      大家讲道理

      http://flask.pocoo.org/docs/0.11/deploying/
      Official deployment method.

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!