-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
46 lines (35 loc) · 974 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
39
40
41
42
43
44
45
46
from flask import Flask, request, session
from flask_session import Session
from helpers import strip_eval, cap
from flask_socketio import SocketIO
from flask_ngrok import run_with_ngrok
from config import Config
import psycopg2
import os
db = ""
# App
app = Flask(__name__)
# App Config
app.config.from_object(Config)
Session(app)
DATABASE_URL = os.environ.get('DATABASE_URL')
# Adding custom functions
app.jinja_env.globals.update(strip_eval=strip_eval)
app.jinja_env.globals.update(cap=cap)
socketio = SocketIO(app)
# Blueprint imports
from users.routes import users
from user_profile.routes import profiling
from search.routes import searches
from main.routes import main
from game.routes import chess
# Registering blueprints
app.register_blueprint(users)
app.register_blueprint(profiling)
app.register_blueprint(searches)
app.register_blueprint(main)
app.register_blueprint(chess)
# Connecting to database
# Running
if __name__ == "__main__":
app.run()