-
Clone the Repository:
git clone https://github.com/McMaster-FAST/backend.git cd backend -
Create and Activate Virtual Environment: Using
uv:uv venv source .venv/bin/activate(Or with standard
venv:python -m venv .venvandsource .venv/bin/activate) -
Install Dependencies:
uv sync
The project uses a .env file for managing secrets and environment-specific settings, system environment variables will take precendence over .env variables.
-
Create your Environment File: Copy the sample file to create your local environment file. This
.envfile is in.gitignoreand should never be committed to source control.cp sample.env .env
-
Edit your
.envFile: Open the.envfile in your editor and fill in the required values. The comments insample.envwill guide you.
-
Apply Database Migrations:
uv run manage.py migrate
-
Run the Development Server:
uv run manage.py runserver
The server will start on
http://localhost:8000/.
If you are doing development and need mock data to test with you can run
To load mock data only if the database is empty:
uv run manage.py load_fixtures
or to load all mock data unconditionally:
uv run manage.py loaddata mock/data.json
To unload mock data:
uv run manage.py unload_fixtures
You can test that the server is running correctly by hitting the API's health check "ping" endpoint.
Endpoint: GET /api/core/ping/
Example using a Browser: With the server running, visit the following URL in your browser: http://localhost:8000/api/core/ping/
Expected Response
{
"message": "pong"
}