title: How to connect to Heroku Database using SQLAlchemy without database url?
body: <p>I'm currently trying to develop a simple python web application on Heroku and I'm trying to connect to the Heroku Postgres database. I've managed to connect, but only through using the database url Heroku provides: </p>
  
  <pre><code>from flask import Flask
  from sqlalchemy import create_engine
  from sqlalchemy.orm import sessionmaker
  from sqlalchemy.ext.declarative import declarative_base
  
  app = Flask(__name__)
  engine = create_engine('postgres://XXXXXXX@XXXXcompute-1.amazonaws.com:XXX')
  Base = declarative_base()
  Base.metadata.bind = engine
  DBSession = sessionmaker(bind=engine)
  session = DBSession()
  </code></pre>
  
  <p>Is there a way to connect to the Heroku database through my python code without having to include the exact url? Thanks!</p>