A Django REST API project for Code Campfire.
For a quick and automated setup, we provide scripts for both macOS and Windows environments:
- Open Terminal and navigate to the project root directory.
- Run the setup script:
chmod +x scripts/setup_mac.sh # Make script executable (first time only) ./scripts/setup_mac.sh - The script will:
- Install required dependencies
- Set up Python 3 and required packages
- Create a virtual environment and install Django
- Create a
.envfile with database settings - Offer to create the PostgreSQL database for you
- Run initial database migrations
- After the script completes, you MUST activate the virtual environment:
source venv/bin/activate - Start the development server:
python3 manage.py runserver
- Access the application at http://localhost:8000/api/hello/
- For future sessions, always activate the virtual environment first:
source venv/bin/activate python3 manage.py runserver
- Open Command Prompt or PowerShell as administrator and navigate to the project root directory.
- Run the setup script:
scripts\setup_windows.bat
- The script will:
- Check for Python and required packages
- Create a virtual environment
- Install project dependencies
- Create a
.envfile with database settings - Offer to create the PostgreSQL database for you
- Run initial database migrations
- After the script completes, verify the virtual environment is activated.
- Start the development server:
python manage.py runserver
- Access the application at http://localhost:8000/api/hello/
- For future sessions, always activate the virtual environment first:
venv\Scripts\activate.bat python manage.py runserver
This guide will help you set up your Debian-based Linux environment for development.
Make sure you have sudo privileges on your system.
This is the recommended environment setup for projects. The team can choose to use a different environment, but less support will be available in the community for differing environments.
-
Update Package Lists
sudo apt update
-
Install Required Dependencies
sudo apt install -y build-essential python3-dev python3-pip python3-venv git \ postgresql postgresql-contrib libpq-dev \ make libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \ wget curl llvm libncurses5-dev libncursesw5-dev xz-utils \ tk-dev libffi-dev liblzma-dev python-openssl jq httpie