/flask-template

⚙️ Stands for python flask base project template (flask + html + pytest)

Primary LanguagePythonMIT LicenseMIT

made-with-python Code style: black License

Flask template

This project contains set of instructions to start working with flask micro-web framework (for reference mostly).

Tools

Usage

Run script from the root directory of the project and open http://localhost:4000 url in your WEB browser:

~ flask run

Please modify .flaskenv file to set your own application environment variables.

Endpoints:

  • / - get home page
    curl -X GET http://0.0.0.0:4000/
  • /details - get details page
    curl -X GET http://0.0.0.0:4000/details
  • /joke - get random joke
    curl -X GET http://0.0.0.0:4000/joke
  • /pokemon - get pokemon list by color
    curl -X GET http://0.0.0.0:4000/pokemon
    curl -X POST http://0.0.0.0:4000/pokemon
    curl -X POST -d 'pokecolor=black' http://0.0.0.0:4000/pokemon

Demo

It's just a quick sample, please don't write front-end like this :)

Screenshot

Run unittests

Please execute command below to launch unittests:

~ pytest -v

Meta

Author – Volodymyr Yahello

Distributed under the MIT license. See LICENSE for more information.

You can reach out me at:

Contributing

  1. clone the repository
  2. configure Git for the first time after cloning with your name and email
  3. pip install -r requirements.txt to install all project dependencies