You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I kept getting this error every time I ran my code and stack overflow solutions didn't help me either so I figured I would come here for help.
My main.py is as follows:
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(name)
##Connect to Database
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///cafes.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
I kept getting this error every time I ran my code and stack overflow solutions didn't help me either so I figured I would come here for help.
My main.py is as follows:
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(name)
##Connect to Database
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///cafes.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
##Cafe TABLE Configuration
class Cafe(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(250), unique=True, nullable=False)
map_url = db.Column(db.String(500), nullable=False)
img_url = db.Column(db.String(500), nullable=False)
location = db.Column(db.String(250), nullable=False)
seats = db.Column(db.String(250), nullable=False)
has_toilet = db.Column(db.Boolean, nullable=False)
has_wifi = db.Column(db.Boolean, nullable=False)
has_sockets = db.Column(db.Boolean, nullable=False)
can_take_calls = db.Column(db.Boolean, nullable=False)
coffee_price = db.Column(db.String(250), nullable=True)
@app.route("/")
def home():
return render_template("index.html")
HTTP GET - Read Record
HTTP POST - Create Record
HTTP PUT/PATCH - Update Record
HTTP DELETE - Delete Record
if name == 'main':
app.run(debug=True)
Thanks!
The text was updated successfully, but these errors were encountered: