How To Run Postgres locally

Posted by Rohit Rayudu on Stack Overflow See other posts from Stack Overflow or by Rohit Rayudu
Published on 2012-12-09T03:27:38Z Indexed on 2012/12/09 11:08 UTC
Read the original article Hit count: 230

Filed under:
|
|
|

I read the Postgres docs for Flask

and they said that to run Postgres you should have the following code

app = Flask(__name__) 
app.config['SQLALCHEMY_DATABASE_URI'] = postgresql://localhost/[YOUR_DB_NAME]' 
db = SQLAlchemy(app)

How do I know my database name?

I wrote db as the name - but I got an error

sqlalchemy.exc.OperationalError: (OperationalError) FATAL:  database "[db]" 
does not exist

Running Heroku with Flask if that helps

© Stack Overflow or respective owner

Related posts about python

Related posts about postgresql