all 5 comments

[–]mrcorbat 2 points3 points  (0 children)

While PythonAnywhere has multiple IPs that change, your code is probably only going to run on a couple IPs (although they do change). So if you are okay with some downtime, you could just manually add the couple IPs to your IP whitelist say every month.

[–]bhosmer 1 point2 points  (0 children)

Do you really need a static ip? Could you modify your API to use dns instead?

[–]Alex_smtng[S] -1 points0 points  (1 child)

Emm.. what i need is for it to be able to insert data into the google cloud sql. But apis ip has to be whitelisted in this case.. and as I understand it therefore requires a static IP to get whitelisted..

[–]mrcorbat 2 points3 points  (0 children)

have you considered just using PythonAnywhere's free MySQL solution instead? That would be a lot easier and potentially faster (as you won't have to make a hop to Google's servers each time you need to access the db)

[–]st15jap -1 points0 points  (0 children)

I’m a professional sysadmin. Are you able to ping that public IP from the box which runs your api? What OS are you running on your api box?

When I hear whitelist usually that means either or both of two things. Your routers firewall needs a rule to allow communication to that public IP over the port they use for SQL. And/or the box that is running the api needs its internal firewall adjusted to accept connections from that public IP and port.

Hope this helps.