Best Flask open-source libraries and packages

Flask jwt auth

JWT User Management and Authentication using Flask and PostgreSQL
Updated 5 months ago

Flask JWT Authentication

Description

Implementation of JWT (JSON Web Token) authentication using Python
with Flask as backend framework to create REST API and PostgreSQL
as database with SQLAlchemy as SQL Connector to Python.

Usage

Using localhost

  • Create new python venv: python -m venv <venv_name>
  • Activate python venv: source <venv_name>/bin/activate
  • Install dependencies: pip install -r requirements.txt
  • Migrate database: python app.py -c migrate
  • Run development server: python app.py

Using docker

  • Just Run docker compose:
    $ docker-compose up -d db && docker-compose run --rm flaskapp /bin/bash -c "cd /opt/services/flaskapp/src && python app.py -c migrate" && docker-compose up -d
  • CAUTION: Fix This!

For API testing, I suggest you to use Postman for testing the API.

API Documentation

For API Docs, you can use Swagger to view the docs.

  • You can access it (Swagger UI) through: <path_to_API>/docs
  • or you can generate json from: <path_to_API>/docs/json

To Do

  • Fix Docker Config
  • Fix OpenAPI Documentation
  • Unit Testing
  • Logger
  • Fix Routing [Done]
  • Add Redis
  • Add Async

Please refer to this: