https://github.com/pceuropa/uwsgi-ini
uWsgi config ini file for Falcon framework. Also example Falcon app are included to check configuration rapidly.
https://github.com/pceuropa/uwsgi-ini
falcon pytest uwsgi
Last synced: about 1 month ago
JSON representation
uWsgi config ini file for Falcon framework. Also example Falcon app are included to check configuration rapidly.
- Host: GitHub
- URL: https://github.com/pceuropa/uwsgi-ini
- Owner: pceuropa
- License: apache-2.0
- Created: 2019-01-15T16:37:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-15T18:11:01.000Z (almost 7 years ago)
- Last Synced: 2024-11-13T05:11:45.288Z (12 months ago)
- Topics: falcon, pytest, uwsgi
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Falcon and uWSGI
Falcon is faster than [flask](https://github.com/pallets/flask), uWSGi [uWSGI](https://github.com/unbit/uwsgi) is faster than [Gunicorn](https://github.com/benoitc/gunicorn).
Test based on [pceuropa/testing-rest-api](https://github.com/pceuropa/testing-rest-api)
DIRECTORY STRUCTURE
-------------------
requirements.txt pythons requirements packages
main.py falcon app
uwsgi.ini contains config file needed to run app by uwsgi
tests.py tests based on pytest
REQUIREMENTS
------------
- Python 3+
- pytest # to tests
INSTALATION
----------
```
virtualenv -p python3 venv && source venv/bin/activate
pip3 install -r requirements.txt
```
CONFIGURATION
----------
Configuration is in uwsgi.ini. Only Set proper patch and ready to run.
RUN
----------
1. Without uwsgi
```
python3 main.py
```
2. With uwsgi but by command. Please run this command on path of application
```bash
uwsgi --http :8000 --wsgi-file main.py --callable app -H $(pwd)/venv/
```
3. With uwsgi with help ini file. Good way to setup systemd
```bash
uwsgi uwsgi.ini
```
Tests
---------------
```
mytest test.py -v
```
Bonus
----------
Nginx configuration
```
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
```
[Stackoverflow topic](https://stackoverflow.com/a/54204573/4950565)