Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ideonate/flask-gunicorn-cmd
Serve a Flask app via Gunicorn by passing filepath to your Flask Python script
https://github.com/ideonate/flask-gunicorn-cmd
Last synced: about 2 months ago
JSON representation
Serve a Flask app via Gunicorn by passing filepath to your Flask Python script
- Host: GitHub
- URL: https://github.com/ideonate/flask-gunicorn-cmd
- Owner: ideonate
- License: apache-2.0
- Created: 2021-04-20T09:19:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-20T09:30:13.000Z (over 3 years ago)
- Last Synced: 2024-10-13T03:38:52.520Z (3 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# flask-gunicorn-cmd
Command line wrapper to run a named Flask script inside a Gunicorn server.
This project is used in [ContainDS Dashboards](https://github.com/ideonate/cdsdashboards), which is a user-friendly
way to launch Jupyter notebooks as shareable dashboards inside JupyterHub. Also works with Streamlit and other
visualization frameworks.## Install and Run
Install using pip.
```
pip install flask-gunicorn-cmd
```The file to start is specified on the command line, for example:
```
flask-gunicorn-cmd ~/Dev/myflaskscript.py
```By default the server will listen on port 8888, importing the Flask app named 'app', or locating the first app.Flask
object that it can find otherwise.To specify a different port, use the --port flag.
To explicitly specify the name of your Flask app, use the --server-name flag.
```
flask-gunicorn-cmd --server-name=app --port=8888 --workers=4 ~/Dev/myflaskscript.py
```To run directly in python: `python -m flask_gunicorn_cmd.main `
## Changelog
- v0.0.6 Change CWD to script's folder, and also add that folder to the Python search path.