This is step-by-step flow to run your Django project:

  1. First, activate the virtual environment:
  2. Make sure you’re in the backend directory:
  3. Apply database migrations (needed for first run and after model changes):
  4. 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.

Leave a Comment

Your email address will not be published. Required fields are marked *