Forums

swift 5.2 fluentpostgresql

I want to configure my swift 5.2 vapor 3 fluentpostgresql app to talk to my postgresql on pythonaywhere:

let config2 = PostgreSQLDatabaseConfig(hostname: "magula6-1249.postgres.pythonanywhere-services", port: 11249, username: "super", password="secret")

What am I doing wrong?

I'm able to talk to postgresql on localhost no problem:

let config = PostgreSQLDatabaseConfig(hostname: "localhost", port: 5432, username: "postgres", database: "mydb4", password: nil, transport: .cleartext) // omitted transport: PostgreSQLConnection.TransportConfig.unverifiedTLS)

We do not expose our users' databases to the internet, so you will not be able to access it from outside of PythonAnywhere. See http://help.pythonanywhere.com/pages/AccessingPostgresFromOutsidePythonAnywhere/

OK what I really want to do is deploy my xCode 11.4 web server to pythonanywhere.

What do you mean by "deploy my xCode 11.4 web server to pythonanywhere"?

Sorry its possible, even easy, to run a web server on localhost:8080 using Vapor 4 in Xcode. And it talks to my local PostgreSQL. But my real postgreSQL is on pythonanywhere, where I've been paying for Django 1.11 hosting and PostgreSQL 9.3.

So of course I want run the Xcode where my customers can use it.

Thanks

Sorry its possible, even easy, to run a web server on localhost:8080 using Vapor 4 in Xcode. And it talks to my local PostgreSQL. But my real postgreSQL is on pythonanywhere, where I've been paying for Django 1.11 hosting and PostgreSQL 9.3.

So of course I want run the Xcode where my customers can use it.

Thanks

I see. Did you see the link Glenn gave? You would have to setup that to access PythonAnywhere postgres from your own machine.