Create basic_endpoints file. Don't put them in __init__.
This commit is contained in:
parent
dec28b321a
commit
b39f2e3f7b
2 changed files with 28 additions and 19 deletions
|
@ -2,6 +2,7 @@ import flask; from flask import request
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from . import album_endpoints
|
from . import album_endpoints
|
||||||
|
from . import basic_endpoints
|
||||||
from . import bookmark_endpoints
|
from . import bookmark_endpoints
|
||||||
from . import common
|
from . import common
|
||||||
from . import photo_endpoints
|
from . import photo_endpoints
|
||||||
|
@ -9,27 +10,8 @@ from . import tag_endpoints
|
||||||
from . import user_endpoints
|
from . import user_endpoints
|
||||||
|
|
||||||
site = common.site
|
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
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
#site.run(threaded=True)
|
#site.run(threaded=True)
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
import flask; from flask import request
|
||||||
|
|
||||||
|
from . import common
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in a new issue