I have a website running on local server ... need help making it public - django

Note: The ip addresses given are not the exact addresses. They are just for examples
I have a website built on flask running on a linux server that is using the internal ip address and a specific port... 192.168.10.10:1001. I know that the works on other computers on the same wifi.
How can I make the ip address public so that I can access the website without the wifi (outside network)? I know my the external ip address of the server... 100.250.250.25.
I have set up port forwarding so that I can 'access' my server from outside the network... 192.168.10.10:1000. I have accessed the server using the port forwarding but again it was on the same network. (Extra Question) Is that enough to access my server outside the network (or even using 100.250.250.25:1000)?
This applies to django as well because I have websites with django that I would like to use my server as well in the future. (Hopefully 192.168.10.10:1002).

You need to deploy your apps in live server like VPS. For the demonstration, you can try Heroku, pythonanywhere. You will find these tutorials available on other sites.

Related

I can access the website locally but can't access it through the internet After openning the port

I want to make my phone a Linux web server, by using the userLand application which gives you the ability to use ubuntu distribution on Andriod.
I already installed Django and ran my server on port 8080 since port 80 is busy (seems logical that android is using it)
and everything is good, it works when I try to access the website from another device on the local network.
so I proceeded to the next step which is making the website accessible from all over the internet then I found that you need to make a port forwarding on the router to allow devices from outside the local network to access a device in the localnetwork .
I followed the following steps :
made the phone's IP static locally
added the configuration needed for the port forwarding (phone's ip, port 8080, etc... )
found the public IP for my phone and used it and with port 8080
it is still not working:
I can access the website locally but can't access it through the internet.
I tried another method by using an already working server from the "AWebServer" application on google play
but still the same problem.
I tried temporarily to disable the firewall on the router but still the same problem
and finally, I tried to open the port on my laptop with OS: Windows 10
instead of the phone OS: Android, and checked with port checker but the port is closed and still the same problem.
I have been trying to solve this for a whole day)), I would be very happy if someone helped me.
thanks
first image
second image
Your ISP might have put you under a NAT, in that case port forwarding might still not work.
Your best bet is to use some sort of SSH Tunnels.
You can try with ngrok.
This will give you a URL to access your application from public internet.
Only caveat here is that ngrok is not free. They have a subscription based model. In the free tier, you can use ngrok but the link url changes after few hours.
If you want to, you can also implement something like ngrok for yourself. Read about ssh tunneling more. This will help you.

[local IP]:[PORT] redirects to public website (Flask, server configuration, local environment)

I want to debug a flask app on mobiles.
My application configuration allows to expose the app to the network:
application.run(host= '0.0.0.0',port=5000,threaded=True)
However, if I load mylocalIP:5000, it redirects to www.example.com, where the production site is hosted, and cannot figure out where it is written to resolve the redirect.
So I cannot see my local environment but in my local machine, and cannot debug the app on other machines - like mobile phones.
Where should I look to solve the problem ?
I must have changed configuration on my machine somewhere, I don't think it is related to flask.
Note: as alternative , I tried use my local host alias:
I'm using a mac, System Preferences > Sharing > Internet Sharing is enabled, other computers in local networks can access my local env at myLocal.local host, but still access to myLocal.local:5000 is forbidden for other machines but my computer.
You can do one thing, install Fiddler app and configure the reverse proxy on your mobile phone. This tutorial will help you to configure fiddler in android applications.
After configuring the reverse proxy, run the flask application on localhost or machine IP and you can access your machine IP on your mobile. Fiddler would also help you to intercept all the calls made to your application. If you don't want to inspect via fiddler you can directly put your mobile on same network of application.

Django go live with Nginx from server on local network

I followed this tutorial to test going live with a django website.
I don't have a DigitalOcean droplet but a local machine I have that eventually could be used as a server. Therefore, in the steps where I had to put the domain name I used the local machine IP address (it's the same IP address I use to login with ssh).
All steps were ok and I have a response from whitin the local machine, i.e., if I open a browser in the local machine and with the IP address, the Django app runs ok.
However, the same does not happen if I open it from an external computer. I'm not sure if it was suppose to work like that. Is it? If not what extra steps do I need to do to go public?

Access wamp server of laptop using numeric IP address with subdomain in the url

My laptop and android mobile are connected to same router. I am able to access wamp running on my laptop using http://192.168.1.108/ but i want to access it like http://test.192.168.1.108/.
Any ideas?
My suggestion is to get a DNS service like noip.com. You can get an DNS address of whatever is available and point to a server in your own network, i.e. 192.168.1.108. I do this all the time.

Django: external access

I have been setting up a Django website using the development server, and it works fine if I access it using the following address in my browser:
localhost:8000
I now want to be able to access the website from another computer (on the same network). I still want to use the development server for now. If my computer's name on the network is myname, and the domain is mydomain.com, then how can I enable this? If I just type in:
myname.mydomain.com:8000
I get a Server not found error.
Thanks.
It's not possible to access your computer like they way you explained in a LAN. There are couple of ways you can let other computers use your dev server directly.
First, run your Django app like this -
$ ./manage.py runserver 0.0.0.0:8000
So that the server listens to all the network interfaces for anyone accessing your IP, not just localhost. Then -
Find out your IP in the network. In the other computer in the same network open the hosts file(In linux, it's at /etc/hosts) and enter a new line -
enter.your.ip.here intended.domainname.com
Then you can access your dev server from that computer by entering intended.domainname.com:8000 or enter.your.ip.here:8000 in the browser. Cons: You have to alter the hosts file in each of the computer you intend to use the domain name instead of IP from and they all have to be in the same network.
You could use localtunnel. Then you can just execute -
$ localtunnel 8000
And it'll give you an url like http://xyz.localtunnel.com which you can share to anybody using the Internet and they'll be able to use your dev server.