Verified Commit d567a6a5 authored by Vojtech Myslivec's avatar Vojtech Myslivec
Browse files

flask: Use python dotenv for application deployment

- Use .flaskenv and .env files to set environment variables
- Use dotenv package to automatically load them
- Add quick development notes
parent 959b4e51
## .env
#
# flask environment file with local variables
FLASK_ENV="development"
## .flaskenv
#
# flask environment file with global variables
FLASK_APP="certapi"
......@@ -5,7 +5,8 @@
__pycache__
*.egg-info/
# Flask main configuration file
# Flask
/.env
/instance/local.cfg
# uwsgi production deployment
......
......@@ -4,3 +4,14 @@
[![coverage report](https://gitlab.labs.nic.cz/turris/sentinel/cert-api/badges/master/coverage.svg)](https://gitlab.labs.nic.cz/turris/sentinel/cert-api/commits/master)
Flask application providing HTTP API for Turris:Sentinel authentication backend.
## Development usage
- Prepare python virtual environment and install `certapi` package (Consider
using `-e` option: `pip install -e .`)
- Create `.env` file with local environment variables (see `.env.example`)
- Set the configuration in `instance/local.cfg`
- Example configuration can be found in `instance/local.cfg.example`
- The default configuration can be found in `certapi/default_settings.py`
- Run the application using `flask run` (Use wsgi server for production!)
......@@ -16,6 +16,7 @@ setup(
packages=["certapi"],
install_requires=[
"flask",
"python-dotenv",
"cryptography",
"redis",
],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment