Home > Software design >  You don't have permission to access that port
You don't have permission to access that port

Time:01-31

In my Django, when I try to run the server, it displays this error. What should be done to fix the error?enter image description here

What should be done to fix the error?[

CodePudding user response:

This error message occurs because another process is currently using the same port. To resolve this issue, you can either change the port number in your Django development server, or stop the other process that's using the port and try again. Here's how to change the port in Django:

Open your settings.py file. Look for the following line: ALLOWED_HOSTS = ['127.0.0.1'] Change the port by modifying the following line: python manage.py runserver 0.0.0.0:<new_port_number> Save and close the file. Restart the development server by running the command python manage.py runserver 0.0.0.0:<new_port_number> Note: Replace <new_port_number> with the desired port number.

CodePudding user response:

You need admin rights try this:

sudo python manage.py runserver 0.0.0.0:80
  • Related