changing the port of django port

  1. Open the terminal or command prompt.

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

  3. Use the following command to run the Django development server on a specific port, replacing '8000' with the desired port number:

python manage.py runserver 8080

Make sure to use an available and unused port.

  1. Access your Django application by opening a web browser and navigating to the new port. For example, if you chose port 8080, enter the following URL:

http://127.0.0.1:8080/

Ensure the port number matches the one you specified in step 3.

  1. Verify that your Django application is running correctly on the new port.

Note: If the port is already in use, you will need to choose a different one and repeat steps 3-5.