1

I am using Flask,Flask-SQLAlchemy, and Postgres. I have set up the Postgres instance to allow local connection only i.e. can be accessed via SSH.

How can I use Flask-SQLAlchemy both Core:

from sqlalchemy import create_engine

engine = create_engine('postgres://etc')

and ORM:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://etc'
db = SQLAlchemy(app)

What do I need to change if my SQLAlchemy code is as above?

Afeez Aziz
  • 1,337
  • 2
  • 12
  • 26

0 Answers0