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

前端 未结 9 597
半阙折子戏
半阙折子戏 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:12

    Might I suggest trying something like pyngrok to programmatically manage an ngrok tunnel for you? Full disclosure, I am the developer of it. Django example here, but it's as easy as installing pyngrok:

    pip install pyngrok
    

    and using it:

    from pyngrok import ngrok
    
    # .ngrok.io" -> "http://localhost:8000">
    http_url = ngrok.connect(8000)
    

    No messing with ports or firewalls or IP addresses, and now you can also inspect the traffic (which is useful since what you're doing here is ongoing development, not running a prod-ready server).

提交回复
热议问题