Tuesday, February 26, 2013

access remote django dev server from local browser

To access a remote Django development server from your local browser....

On the local host, SSH to the remote host:
$ ssh -v -L 9000:localhost:8000 <the remote address>
On the remote host, run the Django dev server:
/path/to/my/django/project$ python manage.py runserver
On the local host, go to http://localhost:9000 in the browser


Using LocalForward in your ~/.ssh/config, add entry

Host myremote
  User eliot
  HostName my.remotehost.com
  LocalForward 9000 localhost:8000

No comments:

Post a Comment