开发者

How can I view a django site running with 'runserver' remotely

开发者 https://www.devze.com 2023-03-29 16:18 出处:网络
I currently have a django project that 开发者_如何学运维I am working on. The project is sitting on my remote webserver, and I start it by running manage.py runserver 0.0.0.0:8000. Howver, if I try to

I currently have a django project that 开发者_如何学运维I am working on. The project is sitting on my remote webserver, and I start it by running manage.py runserver 0.0.0.0:8000. Howver, if I try to access the site via domainname.com:8000, I can't see the site.

How can I view a django project remotely like this? Do I need to do setup using apache? Punch a hole in the firewall? Is there an easy way?

This is strictly for development purposes.


You need to bind it to an IP, not 0.0.0.0.

Also, you may want to check that firewall rules are not stopping you from accessing port 8000 (I did this this morning!)


You can use ssh tunnels. It's easy to set up in Windows with Putty (look at this example for manageing postgresql) or google how to use tunnels with ssh in Linux. I think this is amazing thing, since I first time get to my databse on remote server :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号