Bugfix: 404 errors with request.endpoint

Fixed static folder 404 errors
This commit is contained in:
2022-06-18 02:18:07 +01:00
parent 4414d1720e
commit 17b985d238
5 changed files with 99 additions and 25 deletions

View File

@@ -41,14 +41,11 @@ def create_app():
flash(f'<strong>Cookie Consent</strong>: This web site only stores minimal, functional cookies. It does not store any tracking information. By using this site, you consent to this use of cookies. For more information, see our <a href="{url_for("views._privacy")}">privacy policy</a>.', 'cookie_alert')
@app.errorhandler(404)
def _404_handler(error):
return render_template('404.html')
def _404_handler(error): return render_template('404.html')
@app.errorhandler(CSRFError)
def _csrf_handler():
return jsonify({'error':'Could not validate a secure connection.'}), 403
def _csrf_handler(): return jsonify({'error':'Could not validate a secure connection.'}), 403
@app.context_processor
def _now():
return {'now': datetime.now()}
def _now(): return {'now': datetime.now()}
from app.admin.views import admin
from app.api.views import api