Run Falcon APP with uwsgi
Asked Answered
N

2

5

I just started to learn Falcon (http://falcon.readthedocs.org/en/latest/user/quickstart.html) but it need a web server running and docs suggesting use uwsgi or gunicorn.

though they have mentioned that how to use it with gunicorn

$ pip install gunicorn  #install
$ gunicorn things:app   #and run app through gunicorn.

But I want to run this sample app with uwsgi. but I have no clue how to.

I have installed it pip install uwsgi also gevent as suggested here http://falcon.readthedocs.org/en/latest/user/install.html

but what now. somebody guide me.

Nathalie answered 6/6, 2014 at 18:6 Comment(0)
E
9

You'll probably find your answer on the uWSGI documentation site, specifically try this page: http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html

I've never used Falcon or uWSGI, but it looks like you can probably get away with:

uwsgi --wsgi-file things.py --callable app
Enciso answered 6/6, 2014 at 19:8 Comment(2)
this worked: uwsgi --http :9000 --wsgi-file things.py --callable appNathalie
A shorter version should also work, with --module=things.appKearns
G
2

You can use uwsgi.ini to store configuration and easy run. Good way to setup uwsgi as services. Configuration with virtualenv

[uwsgi]
http = :8000
chdir = /home/user/www/uwsgi-ini
virtualenv = /home/user/www/uwsgi-ini/venv/
wsgi-file = main.py
callable = app
processes = 4
threads = 2
stats = 127.0.0.1:9191

and run in app folder:

uwsgi uwsgi.ini

command with virtualenv

uwsgi --http :8000 --wsgi-file main.py --callable app -H $(pwd)/venv/
Goldarn answered 15/1, 2019 at 18:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.