I've searched for this answer for the past day and a half and I think my issue has something to do with my Pycharm Settings. When I run the code below I don't get any errors but the database file never gets created. I'm trying to recreate the app following this tutorial: https://www.youtube.com/watch?v=2geC50roans
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE__URI'] = 'sqlite:///pin.db'
db = SQLAlchemy(app)
class Pin(db.Model):
id = db.Column(db.Integer, primary_key=True)`enter code here`
title = db.Column(db.Text, unique=False)
image = db.Column(db.Text, unique=False)
db.create_all()
@app.route('/')
def hello_world():
return 'Hello World!'
app.debug = True
if __name__ == '__main__':
app.run()
enter code here
Aucun commentaire:
Enregistrer un commentaire