Skip to content
Snippets Groups Projects
Commit 4915bde2 authored by Bodor Máté's avatar Bodor Máté
Browse files

workshop

parents
Branches
No related tags found
No related merge requests found
Pipeline #700 failed
app.py 0 → 100644
from flask import Flask, request
from flask import render_template
from flask import redirect
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///test.db"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
db = SQLAlchemy(app)
class Task(db.Model):
id = db.Column(db.Integer, primary_key=True)
content = db.Column(db.Text)
done = db.Column(db.Boolean, default=False)
def __init__(self, content):
self.content = content
self.done = False
def __repr__(self):
return "<Content %s>" % self.content
db.create_all()
@app.route("/")
def tasks_list():
return render_template("list.html", name="World")
if __name__ == "__main__":
app.run()
flask
flask-sqlalchemy
black
flake8
\ No newline at end of file
h1 {
color: blue;
text-align: center;
}
\ No newline at end of file
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}"/>
<h1>Hello {{name}}! </h1>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment