-
Notifications
You must be signed in to change notification settings - Fork 1
/
dispatcher.py
41 lines (27 loc) · 1.1 KB
/
dispatcher.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
####################################################################
######### Copyright 2016-2017 BigSQL ###########
####################################################################
from werkzeug.wsgi import DispatcherMiddleware
from flask import Flask
import os, sys, platform
sys.path.append(os.path.join(os.path.dirname(__file__), 'pgadmin'))
this_uname = str(platform.system())
if this_uname == "Darwin":
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib', 'osx'))
elif this_uname == "Linux":
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib', 'linux'))
from pgAdmin4 import app as backend
from web import application as frontend
#from webflask import application as backend
import config
import os
application = Flask(__name__)
application.config.from_object(config)
if not os.path.exists(config.SESSION_DB_PATH):
os.mkdir(config.SESSION_DB_PATH)
os.chmod(config.SESSION_DB_PATH, int('700', 8))
application.wsgi_app = DispatcherMiddleware(frontend.wsgi_app, {
'/admin': backend.wsgi_app
})
if __name__ == '__main__':
application.run()