This project is a starting platform for a SSR (Server Side Rendered) Flask project that pulls data from an external API and caches the result. The project includes a responsive Jinia2 template with Bootstrap.
🏠 Homepage
tbd
Installation script
make setup
This demo requires Python 3.5 and later. The setup command creates a virtual environment (venv) and installs all packages from the requirements.txt file. or
Manual installation
virtualenv venv
source ./venv/bin/activate
pip install -r requirements.txt
You can set the following environment variables:
NAME | required | Comment |
---|---|---|
SECRET_KEY |
no | A secret key used to securely sign the session cookie (Flask). It is not needed for this demo, but every Flask application should have one. You can create your own SECRET_KEY with python -c 'import secrets; print(secrets.token_hex())' . If it is empty, a random string will be generated each time you start it.More information and source |
API_KEY |
yes | You can get your own free OpenWeatherApi key on this website: https://home.openweathermap.org/users/sign_up |
You can either set the environment variables or use the .env
file:
Make your own copy of the .env
file and specify the .env
and add the keys.
cp ./src/.env_default ./src/.env
Learn more about the OpenWeatherMap API: https://openweathermap.org/api
make test
make run
The run command automatically activates the virtual environment (venv) and starts the application in debug mode.
make doc
tbd
👤 Peter Keck
- Github: @pyrrolizin
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Please use Black as code formatter.
Give a ⭐️ if this project helped you!
Copyright © 2022 Peter Keck.
This project is MIT licensed.