This repository contains all the code for the INSA'Roule project.
Follow the following steps to set up a development environment:
-
Create a virtual environment and activate it:
python3 -m venv env source env/bin/activate -
Now that we are in our virtual environment, we need to install the dependencies for the project and for the developement. To do so, we will use
uvby running the following command:pip install uv
uvis a package manager that allows us to install dependencies way faster than the usualpipcommand. -
To install the dependencies, we can run the following command:
uv pip install -r requirements.txt uv pip install -r requirements-dev.txt
-
Copy the
.env.distto.envand fill in the values. -
Install pre-commit hooks by running the following command:
pre-commit install
This will ensure that the code is formatted correctly and that the tests pass before committing.
-
To run the server, you can use the following command (migrate runs the database migrations and compilemessages compiles the translations to be usable directly in the web application):
cd project python manage.py migrate python manage.py compilemessages python manage.py runserver[!NOTE] If you ever run into issues with the database, since this code is currently in development, it is highly recommended to reset the database by deleting the
db.sqlite3file and running the migrations again:rm db.sqlite3 python manage.py migrate