Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>Just in case. I wouldn't do anything of this in production for complex and important app.</em></p> <p>I'd go for reverse proxy + gunicorn. That's what I do most of the times nowadays but with nginx and on linux machines. The problem here is that gunicorn doesn't support windows for now (<a href="https://github.com/benoitc/gunicorn/issues?milestone=7&amp;state=open" rel="nofollow noreferrer">but support is planned</a>). Now you have an option to run your Flask app with gunicorn in Cygwin.</p> <p>The other way around would be to try this <a href="https://serverfault.com/questions/366348/how-to-set-up-django-with-iis-8">https://serverfault.com/questions/366348/how-to-set-up-django-with-iis-8</a> but instead of Django related stuff and especialy</p> <pre><code>from django.core.handlers.wsgi import WSGIHandler as DjangoHandler </code></pre> <p>you need your Flask paths and env variables and</p> <pre><code>from yourapplication import app as FlaskHandler </code></pre> <p><strong>NB</strong>: instead of gunicorn you can try other launchers listed <a href="http://flask.pocoo.org/docs/deploying/wsgi-standalone/" rel="nofollow noreferrer">here</a>. May be there's more luck with Twisted or Tornado on Windows</p> <p><strong>Update: Gunicorn in Cygwin</strong></p> <p>I'm on Window 7 64bit with Cygwin 1.7.5 32bit. Python version 2.6.8.</p> <p>I had some issues running Flask with Cygwin 64bit and Python 2.7 although gunicorn seemed to work ok.</p> <p>You can get Cygwin <a href="http://cygwin.com/install.html" rel="nofollow noreferrer">here</a>.</p> <p>Packages I've installed:</p> <ul> <li>nano</li> <li>python 2.6.8</li> <li>curl</li> </ul> <p>Then I installed pip with:</p> <pre><code>$ curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python $ easy_install pip </code></pre> <p>And then flask and gunicorn:</p> <pre><code>$ pip install flask gunicorn </code></pre> <p>I've made simple <code>app.py</code>:</p> <pre><code>from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ == "__main__": app.run() </code></pre> <p>And run it with gunicorn:</p> <pre><code>$ gunicorn app:app 2013-11-27 16:21:53 [8836] [INFO] Starting gunicorn 18.0 2013-11-27 16:21:53 [8836] [INFO] Listening at: http://127.0.0.1:8000 (8836) 2013-11-27 16:21:53 [8836] [INFO] Using worker: sync 2013-11-27 16:21:53 [6140] [INFO] Booting worker with pid: 6140 </code></pre> <p>After that you'll need to make your gunicorn app to run like <a href="http://cygwin.wikia.com/wiki/Cygrunsrv" rel="nofollow noreferrer">windows service</a>. But that part I haven't done for a long time so memories are shaded:)</p> <p><strong>NB</strong>: I've found another option <a href="https://code.google.com/p/modwsgi/wiki/InstallationOnWindows" rel="nofollow noreferrer">https://code.google.com/p/modwsgi/wiki/InstallationOnWindows</a> if you are ready to try</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload