-5

I want to make the development server in Django be on the internet while running Windows 10. How can I do this?

By the way, when I try to use my external IP, it doesn't work. It says that I can't use it

knbk
  • 52,111
  • 9
  • 124
  • 122
Zium
  • 163
  • 9
  • Assuming your have a public ip, it's as easy as pointing to your http://: from a browser... What is really your question? – mguijarr Dec 18 '16 at 16:42
  • @mguijarr My question is that I'm trying to access my development server anywhere in the world – Zium Dec 18 '16 at 16:46
  • Are you adamant in running the server from your own PC or is your end goal to simply have it accessible over the internet instead of locally? – Erion S Dec 18 '16 at 16:52
  • 1
    It is highly discouraged to use the development server in a public-facing configuration. The development server has not been tested for security, and is highly inefficient. – knbk Dec 18 '16 at 16:53
  • @knbk I would just need to see how good my site looks like when it is live. – Zium Dec 18 '16 at 16:55
  • @ErionV I'm want to run it so that I can access the website anywhere. – Zium Dec 18 '16 at 16:57
  • 1
    Then you can use any number of options to run your site in a production-like environment, ranging from Heroku and the like, to a production-level webserver on your machine, or a VPS. – knbk Dec 18 '16 at 16:57
  • In that case, I would recommend running it on an external server and not giving access to your local server to the rest of the world. Especially if running in debug. You could deploy it to a free dyno on Heroku. Try going through this simple tutorial (https://devcenter.heroku.com/articles/deploying-python) and you should be able to access your Django project anywhere in the world. – Erion S Dec 18 '16 at 17:02

3 Answers3

1

While starting the Django Server, mention the IP and PORT from which you want to accept the requests. Mention 0.0.0.0 to open it for all as:

python manage.py runserver 0.0.0.0:80

By default the Django's server accepts requests only via localhost.

Now make a request via using public IP of the system on which your Django's server is running

Moinuddin Quadri
  • 46,825
  • 13
  • 96
  • 126
1

You can try a deployment on Heroku. Is relativelly easy to set up and provides you with a live server in minutes.

Bogdan
  • 87
  • 7
  • I have added the link to the specific python documentation above. You need an account. The you need to follow the documentation. A great tutorial from django-girls here: https://djangogirls.gitbooks.io/django-girls-tutorial-extensions/content/heroku/ – Bogdan Dec 18 '16 at 17:00
0

Sorry about the confusion, this is an old question but what actually happened was that I didn't add any port forwarding rules on my router. If I did, then the solutions raised by others would've worked. Since I didn't port forward, I just ended up hosting it on heroku.

Zium
  • 163
  • 9