-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (24 loc) · 1004 Bytes
/
main.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
# import requirements needed
from flask import Flask, render_template
from utils import get_base_url
# setup the webserver
# port may need to be changed if there are multiple flask servers running on same server
port = 12345
base_url = get_base_url(port)
# if the base url is not empty, then the server is running in development, and we need to specify the static folder so that the static files are served
if base_url == '/':
app = Flask(__name__)
else:
app = Flask(__name__, static_url_path=base_url+'static')
# set up the routes and logic for the webserver
@app.route(f'{base_url}')
def home():
return render_template('index.html')
# define additional routes here
# for example:
# @app.route(f'{base_url}/team_members')
# def team_members():
# return render_template('team_members.html') # would need to actually make this page
if __name__ == '__main__':
# IMPORTANT: change url to the site where you are editing this file.
app.run(host = '0.0.0.0', port=port, debug=True)