Вылетела простыня текста при попытке создать базу данных через from app import db
from flask import Flask, render_template, url_for
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URL'] = 'sqlite:///blog.db'
db = SQLAlchemy(app)
class Article(db.Model):
id = db.Column(db.Integer, primaty_key=True)
title = db.Column(db.String(100), nullable=False)
intro = db.Column(db.String(300), nullable=False)
text = db.Column(db.Text, nullable=False)
date = db.Column(db.DateTime, default=datetime.utcnow)
def __repr__(self):
return '<Article %r>' % self.id
@app.route('/')
@app.route('/home')
def index():
return render_template("index.html")
@app.route('/about')
def about():
return render_template("about.html")
@app.route('/user/<string:name>/<int:id>')
def user(name,id):
return "User page:" + name + '-' + str(id)
if __name__ == "__main__":
app.run(debug=True)
ошибка
C:\site\venv\lib\site-packages\flask_sqlalchemy\__init__.py:834: FSADeprecationW
arning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be dis
abled by default in the future. Set it to True or False to suppress this warnin
g.
warnings.warn(FSADeprecationWarning(