Dec-24-2019, 02:45 AM
(This post was last modified: Dec-24-2019, 03:08 AM by ichabod801.)
taking a course at the moment which I why do follow examples, but getting the following Name error: name 'name' not defined.
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://suz:COCOchanel88@localhost:5432/suzb' db = SQLAlchemy(app) class Person(db.Model): __tablename__ = 'persons' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(), nullable=False) db.create_all() @app.route('/') def index(): person = Person.query.first() return 'Hello World!'when Ieventually run it in my terminal thats when I get the "nameError: name 'name' is not defined"