Clone the project
git clone https://github.com/Seven-Musketeers/backend
Go to the project directory
cd backend
Install dependencies
We need poetry to install the dependencies and manage them. Refer to this link on how to install poetry.
After the installation, we need to activate the virtual environment. Run this command to activate it.
poetry shell
Then finally install all the dependencies using this command.
poetry install
Environment File Setup
Rename the .env.example
file to .env
to setup the environment file.
Setup Database
To setup the database, we need docker-compose. You can refer to this to install docker-compose
on your system. If you already have postgres installed on your system, make sure to disable it first before running the command below.
After the installation of docker and docker-compose you can run this command to setup the database
docker-compose up -d
This will start the database up in the background.
Run Migrations Before starting the project for the first time we need to make migrations and run the migrate command to sync our database with the latest changes.
First, make the migration files using this command:
python manage.py makemigrations
Then, migrate the database using the migrations files by running this command:
python manage.py migrate
Starting the Project After all the initial setup, we're now ready to start the project up. Run this command to start the project:
python manage.py runserver