Follow these steps to set up and run the project in a development environment.
- Docker and Docker Compose
- Python 3.x
- Git
-
Create a Python Virtual Environment: It is recommended to use a virtual environment to manage your project's dependencies independently.
python -m venv venv
-
Activate the Virtual Environment:
- On Linux/macOS:
source venv/bin/activate - On Windows:
.\venv\Scripts\activate
- On Linux/macOS:
-
Install Python Dependencies: With your virtual environment activated, install all required packages from the
requirements.txtfile.pip install -r requirements.txt
-
Set Up Environment Variables: Copy the environment template file and configure it with your own values:
cp .env.example .env
-
Start the Database: Use Docker Compose to start the database service.
docker-compose up -d
-
Run Database Migrations: Apply the database migrations to set up the schema using the command format mentioned above.
python manage.py migrate
-
Run the Development Server: Start the Django development server using the same
PYTHONPATHsetup.python manage.py runserver
The frontend code is included as a Git submodule.
To initialize and fetch the frontend code, run the following command from the root of the open_schools_marketplace_backend directory:
git submodule update --init