blob: 509ddcbc2225bd24dc7ed5d91703933c2a18d8f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import os
from flask import Flask
from flask_user import SQLAlchemyAdapter, UserManager
from modules.shared.models import db
from modules.interest.models import Interest, UserInterest
from modules.user.models import User, UserAuth
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///development.db'
app.config['SECRET_KEY'] = 'this should definitely be changed to an ' \
'environment variable'
if not os.environ.get('EDU_APP_ENV'):
app.debug = True
db.init_app(app)
with app.app_context():
db.create_all()
# Setup Flask-User
db_adapter = SQLAlchemyAdapter(db, User, UserAuthClass=UserAuth)
user_manager = UserManager(db_adapter, app)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
|