2018-02-03 09:34:07 +00:00
|
|
|
import flask; from flask import request
|
2018-02-03 09:43:41 +00:00
|
|
|
import random
|
2018-02-03 09:34:07 +00:00
|
|
|
|
2018-02-03 09:43:41 +00:00
|
|
|
from .. import common
|
2018-02-03 09:34:07 +00:00
|
|
|
|
|
|
|
site = common.site
|
|
|
|
session_manager = common.session_manager
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
@site.route('/')
|
|
|
|
@session_manager.give_token
|
|
|
|
def root():
|
|
|
|
motd = random.choice(common.P.config['motd_strings'])
|
|
|
|
session = session_manager.get(request)
|
|
|
|
return flask.render_template('root.html', motd=motd, session=session)
|
|
|
|
|
|
|
|
@site.route('/favicon.ico')
|
|
|
|
@site.route('/favicon.png')
|
|
|
|
def favicon():
|
|
|
|
return flask.send_file(common.FAVICON_PATH.absolute_path)
|
|
|
|
|
|
|
|
@site.route('/apitest')
|
|
|
|
@session_manager.give_token
|
|
|
|
def apitest():
|
|
|
|
response = flask.Response('testing')
|
|
|
|
return response
|