0

I have a Django development server running on a remote centos VM on another lan. I have set up port forwarding using Secure CRT to access the web page through my browser from my desk pc. I am currently not using apache with the development server and is shutdown.

I start the server by running python manage.py runserver 0.0.0.0:80.

When I type either the ip or www.localhost.com into the web browser, my URL is read as if it has been doubled with the host being read as if it was also the path.

Page not found (404)##
Request Method: GET
Request URL: http://www.localhost.com/http://www.localhost.com/

When I try to access the development server from within the same LAN the page loads up fine.

I have been searching through the django documentation and stack overflow, but I have yet to find a similar problem to this. Does anyone have any thoughts on why this may be happening and what could be a possible solution?

Thank you very much in advance!

Dominic Cooney
  • 6,317
  • 1
  • 26
  • 38
Django Fett
  • 77
  • 2
  • 11

1 Answers1

0

It looks like the request URL is incorrect: http://www.localhost.com/http://www.localhost.com/ should probably be http://actual_machine_IP.com/

I'd start searching there. You won't be able to access the VM's port 80 from a different lan using localhost as the hostname since localhost is probably already set in your hosts file.

If you want to test your dev environ remotely, can I suggest either setting up Apache properly with port 80 (as opposed to using django's dev server--privilege restrictions and all that can be circumvented with sudo and other bad practice) or use a pre-built shared dev service like vagrant share.

James
  • 118
  • 1
  • 10