Make django server IP public.

I have a window machine with static IP. I have a django server installed on it. How to make a server run on its static IP so that the server is accessible from everywhere.
Vivek AgarwalConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pallavi GodseSr. Digital Marketing ExecutiveCommented:
You will need to run the development server such that it listens on the interface to your network.

For example,
python manage.py runserver 0.0.0.0:8000

Open in new window

listens on every interface on port 8000.

It doesn't matter whether you access the webserver with the IP or the hostname. I guess you are still in your own LAN.

If you really want to access the server from outside, you also have to configure your router to forward port e.g. 8000 to your server.

Check your firewall on your server whether incoming connections to the port in use are allowed!

Assuming you can access your Apache server from the outside successfully, you can also try this:

    Stop the Apache server, so that port 80 is free.
    Start the development server with
sudo python manage.py runserver 0.0.0.0:80

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David Johnson, CD, MVPOwnerCommented:
you also have to forward port 8000 TCP to the machine's ip address.  If you have a dynamic WAN ip address use a service like dyndns.com so you have a NAME and not have to enter the external ip address or worry if it changes.
0
Cyclops3590Commented:
you also need to add the IP or fqdn to the allowed_hosts list depending on how you're accessing the app otherwise you'll just get a 400 bad request error
0
Cyclops3590Commented:
pallavi got most of the answer while I believe david and cyclops added a couple more points of interest that could cause issues when exposing the django server to the internet
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.