-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
38 lines (28 loc) · 947 Bytes
/
app.py
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
33
34
35
36
37
38
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from flask_jwt_extended import JWTManager
from flask_login import LoginManager
from application.config import LocalDevelopmentConfig, db
from application.models import User
app = Flask(__name__, template_folder='templates', static_folder='static')
app.config.from_object(LocalDevelopmentConfig)
db.init_app(app)
api = Api(app)
CORS(app)
jwt = JWTManager(app)
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
# Uncomment this if you want to create tables at startup
# with app.app_context():
# db.create_all()
from application.api.register import *
from application.api.topStocks import *
from application.api.stock import *
from application.api.watchlist import *
if __name__ == '__main__':
app.run(debug=True)