- Install pyenv
- Install the configured python version (3.12.7) using pyenv by running the command
- For Mac/Linux
pyenv install
- For Windows
pyenv install 3.12.7
- For Mac/Linux
- Create virtual environment by running the command
- For Mac/Linux
pyenv virtualenv 3.12.7 venv
- For Windows
python -m pip install virtualenv python -m virtualenv venv
- For Mac/Linux
- Activate the virtual environment by running the command
- For Mac/Linux
pyenv activate venv
- For Windows
.\venv\Scripts\activate
- For Mac/Linux
- Install the project dependencies by running the command
python -m pip install -r requirements.txt
- Create a
.env
file in the root directory, and copy the content from the.env.example
file to it - Install docker and docker compose
- Start MongoDB using docker
docker-compose up -d db
- Start the development server by running the command
python manage.py runserver
- Go to http://127.0.0.1:8000/health/ API to make sure the server it up. You should see this response
{ "status": "UP", "components": { "db": { "status": "UP" } } }
- Install docker and docker compose
- Start Django application and MongoDB using docker
docker-compose up -d
- Go to http://127.0.0.1:8000/health/ API to make sure the server it up. You should see this response
{ "status": "UP" }
- On making changes to code and saving, live reload will work in this case as well
- To run the tests, run the following command
python manage.py test
- To check test coverage, run the following command
coverage run --source='.' manage.py test coverage report
- To run the formatter
ruff format
- To run lint check
ruff check
- To fix lint issues
ruff check --fix