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...

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:
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '15
  • flask import Flask

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture