forked from BCStudentSoftwareDevTeam/celts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·31 lines (22 loc) · 745 Bytes
/
run.py
File metadata and controls
executable file
·31 lines (22 loc) · 745 Bytes
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
#!/usr/bin/env python3
'''
app.py is the starting point of the application; to run the app, in the console, you run "python app.py"
'''
import os
import sys
from app import app
# Builds the server configuration
if os.getenv('IP'):
IP = os.getenv('IP')
else:
IP = '0.0.0.0'
if os.getenv('PORT'):
PORT = int(os.getenv('PORT'))
else:
PORT = 8080
if __name__ == "__main__":
# Print statements go to your log file in production; to your console while developing
print ("Environment:", os.getenv('APP_ENV', 'production'))
print ("Running server at http://{0}:{1}/".format(IP, PORT))
app.run(host = IP, port = PORT, debug = True, threaded = True)
# The next logical place to look is the app/__init__.py file...