user3043594
user3043594

Reputation: 166

How do I host my server from an external ip?

I run the command:

sudo python manage.py runserver 0.0.0.0:8800

But when I enter:

http://xx.xx.xxx.xxx:8800

Where the x's are my external ip. My iPhone can not access the site.

My friend did this before. How do I make this work?

Upvotes: 0

Views: 473

Answers (2)

hanleyhansen
hanleyhansen

Reputation: 6452

A lot of things can be wrong with this. Open ports, firewalls and the list goes on and on. Regardless, the built-in django server is not suitable for production. It's intended for development and a load of one user.

Django says:

DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making Web frameworks, not Web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)

See here for more details.

Upvotes: 5

John Dorian
John Dorian

Reputation: 1904

You probably have to enable port forwarding on your router, it blocks ports so that your external IP address is not vulnerable to attack. In order to do this go into your router's settings and forward the external port 8080 to the machine and port on your network that you are running your server on. You'll probably also want to make sure to reserve an internal IP address for that machine so that it won't change its IP each time you connect to the network, forcing you to change the settings and forward that port to whatever internal IP your machine gets.

Upvotes: 2

Related Questions