App configs settings.py
:
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_URL = '/static/'
STATIC_DIRECTORY = os.path.join(BASE_DIR, 'static')
TEMPLATE_DIRECTORY = os.path.join(BASE_DIR, 'templates')
BASE_TEMPLATE_NAME = 'index.html'
ALLOWED_HOSTS = ['*']
# ALLOWED_HOSTS = [] # for development
# ALLOWED_HOSTS = ['*'] # for docker-compose
# ALLOWED_HOSTS = ["your-production-domain"] # for production
pip install -r requirements.txt
python -m uvicorn main:app --host 0.0.0.0 --port 8000
docker-compose up
Bandit is a tool designed to find common security issues in Python code. To do this Bandit processes each file, builds an AST from it, and runs appropriate plugins against the AST nodes. Once Bandit has finished scanning all the files it generates a report.
bandit -r .
flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.
flake8 .