Skip to content

Starting platform for a SSR (Server Side Rendered) Flask project that pulls data from an external API and caches the result. (includes responsive Jinia2 template with Bootstrap)

License

Notifications You must be signed in to change notification settings

pyrrolizin/flask-api-request

Repository files navigation

Welcome to flask-api-request 👋

Version License: MIT

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.

✨ Demo (OpenWeatherMap-Api - Current weather in Stuttgart, Germany)

tbd

screenshot of the demo application

Install

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 

Environment varaibles

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

Run tests

make test

Usage (Debug only)

make run

The run command automatically activates the virtual environment (venv) and starts the application in debug mode.

Create Documentation

make doc

Deployment on Heroku

tbd

Author

👤 Peter Keck

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. Please use Black as code formatter.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Peter Keck.
This project is MIT licensed.

About

Starting platform for a SSR (Server Side Rendered) Flask project that pulls data from an external API and caches the result. (includes responsive Jinia2 template with Bootstrap)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published