Setting up Python Flask server on internet via Port forwarding
In this post we will cover topics; Starting a server using Python Flask. Accessing server in Local Network. Adding a Port Forwarding rule in NAT settings. Accessing server in Internet via public IP. Difference between static IP and dynamic IP. Step 1 :- As the first step, we need to setup a server on our system.A server exposes your code to a particular port.Some examples are Apache Tomcat, Spring boot (inbuilt), Python Django (inbuilt), Nginx. Here we have a simple server in Python Flask. For a GET request in root path the server returns a "Hello World!".That's it. Going to start the server on my local IP address(192.168.1.105) at default flask port(5000) using below commands, $export FLASK_APP=flaskTest.py $flask run --host=192.168.1.105 Step 2 :- For security purpose all ports for external communication is closed by router's firewall by default. So no communication can be done to outside world. For same reason our server won't be