run django app locally

  1. Open a terminal window.

  2. Navigate to the root directory of your Django project using the cd command.

  3. Activate the virtual environment for your Django project, if you are using one. Use the source command on Unix-like systems or activate on Windows. For example: source venv/bin/activate # Unix-like systemsvenv\Scripts\activate # Windows

  4. Ensure that you have all the required dependencies installed by running: pip install -r requirements.txt

  5. Apply any pending database migrations using the following command: python manage.py migrate

  6. Start the development server using the following command: python manage.py runserver

  7. Open your web browser and navigate to the specified address, usually http://127.0.0.1:8000/.

  8. If you are using a different port or host, the server output in the terminal will indicate the correct address. Open that address in your web browser.

  9. You should now see your Django app running locally. Any changes you make to your code will be automatically reflected if you are running the development server with the runserver command.

  10. To stop the development server, you can press Ctrl + C in the terminal where it is running.