-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
38 lines (27 loc) · 889 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 database import db
from os import path
from routes import authentication, lesson_creation, fetching_data
from secrets import token_urlsafe
from flask_session import Session as ServerSideSession
from flask_cors import CORS
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + path.abspath(
"database/project_future_school.sqlite"
)
db.init_app(app)
with app.app_context():
db.create_all()
app.register_blueprint(authentication)
app.register_blueprint(lesson_creation)
app.register_blueprint(fetching_data)
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"] = "filesystem"
app.config["SECRET_KEY"] = token_urlsafe(16)
ServerSideSession(app)
CORS(app)
@app.route("/", methods=["GET"])
def hello_world(): # put application's code here
return "Hello World!!!"
if __name__ == "__main__":
app.run()