Environment
Configuration
Parameter | Description | Default |
---|---|---|
debug |
Enable the debug logs output | false |
logging_file |
Enable saving log records to file. This will create a .logs folder |
false |
host |
Bind the socket to this host address. Set 0.0.0.0 to make the application available on your local network |
127.0.0.1 |
port |
Bind to a socket and run the application with this port | 8000 |
reload |
Enables automatic reloading of the application when files are modified | false |
You can configure some parameters for the application in the pyproject.toml
file, such as:
pyproject.toml | |
---|---|
You can also set environment variables to override the default configuration when running the application locally or in a Docker container.
Python Environment
It is necessary to prepare an environment with the correct dependencies to work properly with each area of the application. To do this, you need to install Python3 v3.11
with Venv and Pip.
Info
This project uses Poetry to package and manage Python dependencies.
Tip
You can also use Docker to run the application.
Setup the Virtual Environment
Dependencies
Complete Environment
Install all dependencies.
Application Environment
Install only the application dependencies.
Run the application
Development Environment
Install only the development dependencies.
Perform Formatting, Linting, and Vulnerability Auditing.
# run Formatting
(.venv) make format
# run Linting
(.venv) make lint
# run Linting in Tests
(.venv) make lint-tests
# run Audit Vulnerability
(.venv) make audit
Tests Environment
Install only the tests dependencies.
Run the tests and check the tests coverage
Documentation Environment
Install only the documentation dependencies.
Run Mkdocs documentation.
Run Locally and access the web page at http://127.0.0.1:8000.
Requirements Files
You can generate multiple requirements files for different purposes.
# Requirements only for the Application dependencies
(.venv) make req
# Requirements for the Application with Development dependencies
(.venv) make req-dev
# Requirements for the Documentation dependencies
(.venv) make req-docs
# Requirements for the Tests dependencies
(.venv) make req-test
# Requirements for All dependencies
(.venv) make req-all