Forums

Can't connect to database when cloning a PA project into a different PA account.

So I have my pythonanywhere project up on github and I'm trying to get my team to be able to clone it into their pythonanywhere accounts, run pip install -r requirements.txt in their virtualenvs, and then deploy the cloned project by adjusting the wsgi file to point to the proper path. Theoretically once the wsgi file is setup they should be able to pull the project, make changes, and then view those changes on their username.pythonanywhere.com domain before pushing back to github. For some reason, though, after setting everything up and reloading the site, I'm getting an error message that the site can't connect to my database. There are no IP restrictions on the database, so there shouldn't be any problem connecting. (I have no issues on my pythonanywhere account where the main project is hosted). What could be the issue here? Btw, I'm testing this on a free account and the database is an external postgres database that is SSL encrypted. Are there any restrictions on free accounts on connecting to databases? The main paid account that hosts the working project does NOT have the postgres option turned as we are using databaselabs to host our database.

Hi there, I think you've guess correctly. Free users have restricted Internet access. That includes a whitelist of sites, which are available over the HTTP/HTTPS protocol, but for non-HTTP protocols like postgres's, it won't work.

You could look at using sqlite for development, and postgres for production maybe?