How to access the local Django webserver from outside world

I followed the instructions here to run Django using the built-in webserver and was able to successfully run it using python manage.py runserver. If I access 127.0.0.1:port locally from the webserver, I get the Django page indicating it worked.

I realize the Django webserver is not a production server, but it’s important for me for testing purposes to be able to access it from the outside world — i.e. not from a web browser on the server, but from a different computer.

I tried:

http://mywebserver:port_django_runs_on

but it did not work. I also tried using the IP instead (based on ifconfig) to access:

http://myipaddress:port_django_runs_on 

which did not work either.

The web server is running so it must be accessible from the outside, I’m just not sure how. I am running Linux with Apache, though I have not configured Django with Apache.

Any ideas on how to do this?

11 Answers
11

Leave a Comment