Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
It is highly recommended to open this project inside a Devcontainer*.
If you are developing locally instead, you will need Python on your host system.
It is recommended to use Poetry* instead of venv.
If you are using venv anyway, you can set up the environment with the following commands:
python -m venv .venv
source .venv/bin/activate # <-- Linux/MacOS
.venv\Scripts\activate # <-- Windows
* More information about Devcontainers
A Devcontainer is a containerized development environment that can be used with Visual Studio Code.
It ensures that everyone in the team not only has the same dependencies installed, but also the same OS, tools, settings, VSCode extensions, ...
It uses Docker under the hood and can be configured using a devcontainer.json
file inside the .devcontainer
directory.
To use a Devcontainer, you need to have Docker and Visual Studio Code installed on your host system. Follow the instructions in the Devcontainer README to set up the environment.
* More information about Poetry
Poetry is a venv-like solution with great dependency management.
It uses a pyproject.toml
file rather than a requirements.txt
file.
With venv, you need to manually add packages to requirements.txt
after every pip install
.
Poetry automatically updates pyproject.toml
after every poetry add
.
Venv | Poetry | |
---|---|---|
Create environment | python -m venv .venv |
poetry init |
Activate environment | source .venv/bin/activate or .venv\Scripts\activate |
poetry shell |
Install single dependency | pip install <package> |
poetry add <package> |
Install all dependencies | pip install -r requirements.txt |
poetry install |
To install Poetry, run the following commands:
pip install poetry
# Confirm the installation was successful
poetry --version
-
Install the required dependencies
pip install -r requirements.txt
-
Create a
.env
file in the root of the projectSECRET_KEY=your_secret_key
-
Run the project locally
python main.py
-
Open your browser and go to http://localhost:5000
To deploy this project you will need Docker with Docker Compose.
-
Create a new repository on Docker Hub
-
Execute the following commands in the terminal
docker login docker build -t project_name:version . docker tag project_name:version your_docker_username/your_repository_name:version docker push your_docker_username/your_repository_name:version
- Improve the design
- Add more features
- Add more tests
- Add more documentation
Issue | Solution |
---|---|
Any problem regarding Devcontainers. | Check the Devcontainer README file. |
Poetry environment not showing up in VSCode. | Reload your VSCode window. If the problem persists, run poetry init && poetry install and reload again. |