-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwsgi.py
61 lines (42 loc) · 1009 Bytes
/
wsgi.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WSGI script
Setup Application, Authentication, ...
"""
import os
from eve import Eve
from evedom import loader
# from your_app.authentication.token import TokenBasedAuth
__author__ = "nam4dev"
__created__ = '08/11/2017'
ROOT_PATH = os.path.dirname(
os.path.abspath(__file__)
)
EVE_SETTINGS = os.path.join(ROOT_PATH, 'settings.py')
def runner(*_, **options):
"""
A simple runner
Args:
*_:
**options:
Returns:
Flask App run
"""
arguments = dict(
debug=1,
port=5000,
)
arguments.update(options)
if 'EVE_SETTINGS' not in os.environ:
os.environ['EVE_SETTINGS'] = EVE_SETTINGS
application = Eve(
settings=EVE_SETTINGS,
# auth=TokenBasedAuth,
)
application.root_path = ROOT_PATH
with application.app_context():
loader.init()
return application.run(**arguments)
if __name__ == "__main__":
exit(runner())