- First, activate the virtual environment:
- Make sure you’re in the backend directory:
- Apply database migrations (needed for first run and after model changes):
- Start the Django development server:
The server will start at http://127.0.0.1:8000/ (or http://localhost:8000/ )
Additional useful commands:
- Create a superuser (for admin access):
- Create new migrations after model changes:
python3 manage.py makemigrations
- When you’re done, deactivate the virtual environment:
deactivate
Remember that the Django server needs to be running alongside your Next.js frontend for the full-stack application to work properly.