Commit 6991aa7c authored by Mathis Dedial's avatar Mathis Dedial
Browse files

Switch to more sensible project structure for SQLAlchemy models

parent 55fb8fb7
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from .models import db
app = Flask(__name__)
app.config.from_pyfile('./config.py')
db = SQLAlchemy(app)
from app import routes
# Bind SQLAlchemy to Flask app
db.init_app(app)
from app import views
'''Contains model definitions for SQLAlchemy ORM'''
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Burger(db.Model):
pass
'''Contains all views'''
from app import app
@app.route('/')
......
-- Setup script for local testing
CREATE USER amivburger IDENTIFIED BY PASSWORD 'amivburgerpassword';
CREATE USER amivburger IDENTIFIED BY 'amivburgerpassword';
CREATE DATABASE amivburger;
GRANT ALL PRIVILEGES ON amivburger.* TO amivburger;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment