In step 13, I can’t get db.create_all() to work. When I reference the ‘db’ variable in terminal I get “”, so I assume it’s at least creating and recognizing the db instance. There is no error when I run db.create_all() but it also doesn’t seem to create a .db* extension.
from flask import Flask, render_template
#import SQLALchemy
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
#set the SQLALCHEMY_DATABASE_URI key
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = 'sqlite:///song_library.db'
app.config['SECRET_KEY'] = 'you-will-never-guess'
#create an SQLAlchemy object named `db` and bind it to your app
db = SQLAlchemy(app)
#a simple initial greeting
@app.route('/')
@app.route('/index')
def greeting():
return render_template('greeting.html')
# app name
@app.errorhandler(404)
def not_found(e):
return render_template("404.html")
#uncomment the code below here when you are done creating database instance db and models
import routes