How to make Django's devserver public ? Is it generally possible?

前端 未结 9 580
半阙折子戏
半阙折子戏 2020-12-08 10:03

I\'m currently trying out the Django framework and I would share/present/show some stuff I\'ve made to my workmate/friends. I work in Ubuntu under Win7 via VMware. So my wis

相关标签:
9条回答
  • 2020-12-08 10:28

    You need to configure bridged networking in VMWare and also grant access to the target port in Ubuntu firewall.

    0 讨论(0)
  • 2020-12-08 10:30

    192.168.*.* is a LAN-private address -- once you've done the proper VMWare (or other VM manager) and firewall incantations to make it accessible from the LAN, it still won't be accessible from outside the LAN, i.e., from the internet at large (a good thing too, because such development servers are not designed for security and scalability).

    To make some port of a machine with a LAN-private IP visible to the internet at large, you need a router with a "virtual servers" ability (many routers, even cheap ones, offer it, but it's impossible to be specific about enabling it since each brand has its own idiosyncratic way). I would also recommend dyndns or other similar service to associate a stable DNS name to your always-varying public IP (unless you're splurging for a static IP from your connectivity provider, of course, but the latter option is becoming costlier all the time).

    superuser.com or serverfault.com may provide better answers and details (once you give every single little detail of your configuration in a question) since the question has nothing much to do with software development and everything to do with server administration and configuration.

    0 讨论(0)
  • 2020-12-08 10:32

    If you are using Virtualbox, You need to change the network setting in VB from "NAT" to "Bridged Adaptor". Then restart the linux. Now if you run sudo ifconfig you are able to see your IP address like 192.168.*.* . The last step is runserver

    python manage.py runserver 192.168.*.*:8000

    Cheers!

    0 讨论(0)
提交回复
热议问题