Skip to content
Snippets Groups Projects
Commit 78b51ab3 authored by Rachel Gaubil's avatar Rachel Gaubil
Browse files

[func] add redirection to avoid err 404 (closes #3)

parent d21a0cd7
No related branches found
No related tags found
1 merge request!37[func] add redirection to avoid err 404 (closes #3)
......@@ -29,11 +29,18 @@ def page(bookNb="1", chapName="", pageNb="", visu=""):
else:
chapUrl += chapName + ".htm.j2"
chapName = chapName.split(".")[0]
return render_template('book'+bookNb+'.html.j2', chap=chapUrl, chapName=chapName, pageNb=pageNb, visu=visu)
try:
return render_template('book'+bookNb+'.html.j2', chap=chapUrl, chapName=chapName, pageNb=pageNb, visu=visu)
except Exception:
return render_template('index.html.j2')
@app.route('/<vueName>')
def vue(vueName=None):
return render_template(vueName+'.html.j2')
try:
return render_template(vueName+'.html.j2')
except Exception:
return render_template('index.html.j2')
if __name__ == '__main__':
#changer de port : (par défaut Flask utilise le 5000)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment