Home > database >  How to deploy python app on my windows PC
How to deploy python app on my windows PC

Time:09-11

this is my problem. I have implemented a simple app in Python with Plotly and Flask to play with my friends around the country. This app has also a DB connection (MySQL).

  1. Can I use my own PC as a public server to allow my friends to connect to the app (they are under other networks)? I've tried to set Flask host='0.0.0.0' but in this way, the app can only be reached by people under my own network.

  2. If it is not possible to use my pc as a server to open my own service to the outside, are there any FREE servers online to deploy apps? (Heroku is not a solution because it will remove free dynos from November 28th).

Thanks.

CodePudding user response:

If you have a static IP, solution is very easy, you just need to do the port mapping. If you dont have a static IP, you should check if your ISP gives you one, if not can buy one, it is up to you. Also you can simply use Hamachi for your friends to connect your server on your pc.

CodePudding user response:

You need to configure a VPN (you could take a look at Hamachi VPN or OpenVPN) between the workstation hosting the MySQL database and the computers of your team mates or the MYSQL database needs to be hosted at a publicly accessible host. Essentially, a cloud platform like digital ocean, Azure or AWS. Either option will have an IP address that you set in the python file that bears the database connection details, replacing the 0.0.0.0 mentioned up there. Further, you'll need to allow inbound connections to MYSQL service while setting the bind-address in the MYSQL configuration file to 0.0.0.0

  • Related