-
-
Save Echocage/f427b071cd6ef76d7f6db58c8a7eabb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
from flask_sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db' | |
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False | |
db = SQLAlchemy(app) | |
from models import Submission #Can only be imported after db is created, trying to figure out how to move it to the top | |
@app.route('/') | |
def render_static(): | |
return render_template('lookup.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import Column, Integer, DateTime, String, Text, func | |
import app | |
class User(app.db.Model)://requires app.db to be created | |
__tablename__ = 'users' | |
id = Column(Integer, primary_key=True, autoincrement=True) | |
email = Column(String(120), unique=True, nullable=False) | |
password = Column(String(120), nullable=False) | |
def __repr__(self): | |
return '<User %r>' % self.username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment