api: fix some missing imports
parent
f578cc8d1a
commit
23ff1a9775
|
@ -20,7 +20,7 @@ from files.routes.jinja2 import *
|
|||
from .admin import *
|
||||
from .comments import *
|
||||
from .errors import *
|
||||
from .docs import *
|
||||
from .api import *
|
||||
from .reporting import *
|
||||
from .front import *
|
||||
from .login import *
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
import xml.etree.ElementTree as ET
|
||||
|
||||
from flask import render_template
|
||||
|
||||
from files.routes.wrappers import auth_required, auth_desired
|
||||
from files.__main__ import app
|
||||
|
||||
tree = ET.parse('docs/api.xml')
|
||||
|
||||
@app.get("/api")
|
||||
@auth_required
|
||||
def api(v):
|
||||
return render_template("api.html", v=v)
|
||||
|
||||
@app.get("/api/docs")
|
||||
@auth_desired
|
||||
def get_docs_page():
|
||||
# TODO cache
|
||||
root = tree.getroot()
|
||||
|
||||
return render_template("docs.html", root=tree.getroot())
|
|
@ -1,13 +0,0 @@
|
|||
import xml
|
||||
import xml.etree.ElementTree as ET
|
||||
from files.__main__ import app, cache, limiter
|
||||
|
||||
tree = ET.parse('docs/api.xml')
|
||||
|
||||
@app.get("/dev/api")
|
||||
@auth_desired
|
||||
def get_docs_page():
|
||||
# TODO cache
|
||||
root = tree.getroot()
|
||||
|
||||
return render_template("docs.html", root=tree.getroot())
|
|
@ -188,11 +188,6 @@ def log_item(id, v):
|
|||
def static_megathread_index(v):
|
||||
return render_template("megathread_index.html", v=v)
|
||||
|
||||
@app.get("/api")
|
||||
@auth_required
|
||||
def api(v):
|
||||
return render_template("api.html", v=v)
|
||||
|
||||
@app.get("/contact")
|
||||
@app.get("/contactus")
|
||||
@app.get("/contact_us")
|
||||
|
|
Loading…
Reference in New Issue