-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.py
43 lines (27 loc) · 1002 Bytes
/
application.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
#!/usr/bin/env python
import flask
import os
from flask import Flask, jsonify, request, url_for, render_template, redirect, send_from_directory, session as login_session
from flask_bootstrap import Bootstrap
def create_app():
app = Flask(__name__)
Bootstrap(app)
return app
app = Flask(__name__)
app.config['DEBUG'] = True
def url_for_other_page(page):
args = request.view_args.copy()
args['page'] = page
return url_for(request.endpoint, **args)
app.jinja_env.globals['url_for_other_page'] = url_for_other_page
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static'),'favicon.ico', mimetype='image/vnd.microsoft.icon')
@app.route('/')
def index():
#if 'username' in login_session:
# return 'You are logged in as ' + login_session['username']
return flask.render_template('index.html')
if __name__ == '__main__':
app.secret_key = 'fdsfmkrtjkfmdslfjfssgshfklsnvdsklj'
app.run(host='0.0.0.0')