Best Flask open-source libraries and packages

Test_flask

Prebuild for Flask cookiecutter
Updated 3 years ago
cookiecutter-django-rest

App

Flask best practices template

license badge Build Status python badge

Demo

Your demo project

How to clone

You can clone this repository

git clone https://github.com/eocode/App

File structure

  • app (Flask configurations project)
    • init (Create and initialize app)
    • config (All settings environments)
    • connection (Settings for SQLAlchemy)
    • envs (Injectable envs in app)
    • commands (Tools for switch environments and other quick utilities)
    • img (Project images for documentation)
    • requirements (Dependencies files for app)
  • test
  • migrations (Migrations files, not public, disabled by gitignore)
  • labs (Labs for create quick scripts for analize problem, you can disabled by gitignore)
  • modules Your project modules
    • example (Main blueprint Flask module)

Dependencies

  • Flask
  • python-dotenv
  • Flask-sqlalchemy
  • Psycopg2
  • Pytest
  • Flask-migrate

Environment configuration

Edit envs/.env.* and add your configuration

Then execute:

python app/commands/environment.py development

Available params:

  • production
  • testing
  • development

Use on local

To install this project just type

Create virtual enviroment:

$ python -m venv env

Active your enviroment

Install dependencies

$ pip install -r requirements.txt

Run the project

$ flask run

Dockerized app

Start app

docker compose up -d

Stop app

docker compose down

Rebuild app

docker-compose up -d --build

Access to command line interface

docker exec -it flask-app bash

Run migrations

By default migrations foldar has been add to .gitignore

Open Terminal

docker exec -it flask-app bash

Init database migrations

flask db init

Generate migrations

flask db migrate

Run migrations

flask db upgrade

Show more commands

flask db

Run tests

On Docker

docker-compose exec queens-app pytest

or only

pytest

Ejecute coverage report

coverage run -m pytest
coverage report
coverage html

Preview

Your image project previews

How to contribute

  • Review our code of conduct

License

View in https://github.com/eocode/App/blob/master/LICENSE

Tags pytest python