I've been following basic tutorial on how to create a web application with a Postgres DB. Not sure what I'm doing wrong and could use some help.
I've seen two other similar questions here on SO but I am not getting any of the errors that those folks are getting but neither are the tables being created.
I have the following code in app.py:
from flask import Flask, render_template, request
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLAlchemy_DATABASE_URI']=
'postgresql://postgres:password@localhost/
Height_collector'
db=SQLAlchemy(app)
class Data(db.Model):
__tablename__="data"
id=db.Column(db.Integer, primary_key=True)
email_=db.Column(db.String(120), unique=True)
height_=db.Column(db.Integer)
def __init__(self, email_, height_):
self.email_=email_
self.height_=height_
the tutorial then has me to to the command prompt, run python, then:
from app import db
Which returns the following error:
'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. '
C:\admSh\FlaskApp\venv\lib\site-packages\flask_sqlalchemy\__init__.py:794:
FSADe precation Warning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant
overhead and will be disabled by default in the future. Set it to True or
False to suppress this warning.
I then type:
db.create_all()
The tutorial magically shows the tables being created but my tables aren't created. I'm table-less :( Anyone know what I can do?