Study Resources
Main Menu
by School
by Textbook
by Literature Title
Study Guides
Infographics
by Subject
Expert Tutors
Contributing
Main Menu
Earn Free Access
Upload Documents
Refer Your Friends
Earn Money
Become a Tutor
Apply for Scholarship
For Educators
Log in
Sign up
Find
Study Resources
by School
by Textbook
by Literature Title
Study Guides
Infographics
by Subject
Ask
Expert Tutors
You can ask
!
Earn by
Contributing
Earn Free Access
Learn More >
Upload Documents
Refer Your Friends
Earn Money
Become a Tutor
Apply for Scholarship
Are you an educator?
Log in
Sign up
University of British Columbia
COMPUTER S
COMPUTER S 2034
XuZpy5rU.txt - from flask import Flask request render_template redirect url_for from flask_sqlalchemy import SQLAlchemy app = Flask_name
XuZpy5rU.txt - from flask import Flask request...
School
University of British Columbia
Course Title
COMPUTER S 2034
Uploaded By
WoodJack09
Pages
1
This
preview
shows page
1
out of
1
page.
from flask import Flask, request, render_template, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///databade.db'
db = SQLAlchemy(app)
class user(db.Model):
id = db.Column(db.Integer,primary_key=True)
name = db.Column(db.String(80))
email = db.Column(db.String(80))
passwd = db.Column(db.String(80))
@app.route("/")
def index():
return render_template("index.html")
@app.route("/login", methods=["GET","POST"])
def login():
if request.method == "POST":
username = request.form["username"]
password = request.form["password"]
login = user.query.filter_by(name = username, passwd = password)
if login is not None:
You've reached the end of your free preview.
Want to read the whole page?
TERM
Fall '15
TAGS
flask import Flask
Share this link with a friend:
Copied!