Bugfix: 404 errors with request.endpoint
Fixed static folder 404 errors
This commit is contained in:
parent
4414d1720e
commit
17b985d238
@ -2,16 +2,17 @@
|
|||||||
<meta property="og:locale" content="en_UK" />
|
<meta property="og:locale" content="en_UK" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
||||||
<meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **request.view_args) }}" />
|
<meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **(request.view_args or {})) }}" />
|
||||||
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
|
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
|
||||||
<meta property="og:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
|
<meta property="og:image" content="{{ url_for('.static', filename='favicon.png', _external = True) }}" />
|
||||||
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
||||||
<meta property="og:image:width" content="512" />
|
<meta property="og:image:width" content="512" />
|
||||||
<meta property="og:image:height" content="512" />
|
<meta property="og:image:height" content="512" />
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
||||||
<meta name="twitter:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
|
<meta name="twitter:image" content="{{ url_for('.static', filename='favicon.png', _external = True) }}" />
|
||||||
<meta name="twitter:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
<meta name="twitter:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
||||||
<meta name="twitter:creator" content="@viveksantayana" />
|
<meta name="twitter:creator" content="@viveksantayana" />
|
||||||
<meta name="twitter:site" content="@viveksantayana" />
|
<meta name="twitter:site" content="@viveksantayana" />
|
||||||
<meta name="theme-color" content="#343a40" />
|
<meta name="theme-color" content="#343a40" />
|
||||||
|
<link rel="shortcut icon" href="{{ url_for('.static', filename='favicon.ico') }}">
|
@ -2,16 +2,17 @@
|
|||||||
<meta property="og:locale" content="en_UK" />
|
<meta property="og:locale" content="en_UK" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
||||||
<meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **request.view_args) }}" />
|
<meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **(request.view_args or {})) }}" />
|
||||||
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
|
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
|
||||||
<meta property="og:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
|
<meta property="og:image" content="{{ url_for('.static', filename='favicon.png', _external = True) }}" />
|
||||||
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
||||||
<meta property="og:image:width" content="512" />
|
<meta property="og:image:width" content="512" />
|
||||||
<meta property="og:image:height" content="512" />
|
<meta property="og:image:height" content="512" />
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
||||||
<meta name="twitter:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
|
<meta name="twitter:image" content="{{ url_for('.static', filename='favicon.png', _external = True) }}" />
|
||||||
<meta name="twitter:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
<meta name="twitter:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
||||||
<meta name="twitter:creator" content="@viveksantayana" />
|
<meta name="twitter:creator" content="@viveksantayana" />
|
||||||
<meta name="twitter:site" content="@viveksantayana" />
|
<meta name="twitter:site" content="@viveksantayana" />
|
||||||
<meta name="theme-color" content="#343a40" />
|
<meta name="theme-color" content="#343a40" />
|
||||||
|
<link rel="shortcut icon" href="{{ url_for('.static', filename='favicon.ico') }}">
|
@ -1,8 +1,82 @@
|
|||||||
{% extends "components/base.html" %}
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link
|
||||||
|
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
|
||||||
|
rel="stylesheet"
|
||||||
|
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
|
||||||
|
crossorigin="anonymous">
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="{{ url_for('views.static', filename='css/style.css') }}"
|
||||||
|
/>
|
||||||
|
<link rel="shortcut icon" href="{{ url_for('views.static', filename='favicon.ico') }}">
|
||||||
|
{% block style %}
|
||||||
|
{% endblock %}
|
||||||
|
<title>{% block title %} SKA Referee Test Beta {% endblock %}</title>
|
||||||
|
</head>
|
||||||
|
<body class="bg-light">
|
||||||
|
|
||||||
{% block content %}
|
{% block navbar %}
|
||||||
|
{% include "components/navbar.html" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
<div class="container quiz-container">
|
||||||
|
{% block top_alerts %}
|
||||||
|
{% include "components/server-alerts.html" %}
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
<h1>Page Not Found</h1>
|
<h1>Page Not Found</h1>
|
||||||
<p>
|
<p>
|
||||||
The page you were looking for does not exist. Try going back and navigating to the desired destination correctly.
|
The page you were looking for does not exist. Try going back and navigating to the desired destination correctly.
|
||||||
</p>
|
</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
<footer class="container site-footer">
|
||||||
|
{% include "components/footer.html" %}
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- JQuery, Popper, and Bootstrap js dependencies -->
|
||||||
|
<script
|
||||||
|
src="https://code.jquery.com/jquery-3.6.0.min.js"
|
||||||
|
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
||||||
|
crossorigin="anonymous">
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
window.jQuery || document.write(`<script src="{{ url_for('.static', filename='js/jquery-3.6.0.min.js') }}"><\/script>`)
|
||||||
|
</script>
|
||||||
|
<script
|
||||||
|
src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"
|
||||||
|
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
|
||||||
|
crossorigin="anonymous">
|
||||||
|
</script>
|
||||||
|
<script
|
||||||
|
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
|
||||||
|
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
></script>
|
||||||
|
<!-- Custom js -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var csrf_token = "{{ csrf_token() }}";
|
||||||
|
|
||||||
|
$.ajaxSetup({
|
||||||
|
beforeSend: function(xhr, settings) {
|
||||||
|
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
|
||||||
|
xhr.setRequestHeader("X-CSRFToken", csrf_token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="{{ url_for('views.static', filename='js/script.js') }}"
|
||||||
|
></script>
|
||||||
|
{% block script %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -2,16 +2,17 @@
|
|||||||
<meta property="og:locale" content="en_UK" />
|
<meta property="og:locale" content="en_UK" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
||||||
<meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **request.view_args) }}" />
|
<meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **(request.view_args or {})) }}" />
|
||||||
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
|
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
|
||||||
<meta property="og:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
|
<meta property="og:image" content="{{ url_for('.static', filename='favicon.png', _external = True) }}" />
|
||||||
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
||||||
<meta property="og:image:width" content="512" />
|
<meta property="og:image:width" content="512" />
|
||||||
<meta property="og:image:height" content="512" />
|
<meta property="og:image:height" content="512" />
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
|
||||||
<meta name="twitter:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
|
<meta name="twitter:image" content="{{ url_for('.static', filename='favicon.png', _external = True) }}" />
|
||||||
<meta name="twitter:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
<meta name="twitter:image:alt" content="Logo of the SKA Refereeing Exam App" />
|
||||||
<meta name="twitter:creator" content="@viveksantayana" />
|
<meta name="twitter:creator" content="@viveksantayana" />
|
||||||
<meta name="twitter:site" content="@viveksantayana" />
|
<meta name="twitter:site" content="@viveksantayana" />
|
||||||
<meta name="theme-color" content="#343a40" />
|
<meta name="theme-color" content="#343a40" />
|
||||||
|
<link rel="shortcut icon" href="{{ url_for('views.static', filename='favicon.ico') }}">
|
@ -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')
|
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)
|
@app.errorhandler(404)
|
||||||
def _404_handler(error):
|
def _404_handler(error): return render_template('404.html')
|
||||||
return render_template('404.html')
|
|
||||||
@app.errorhandler(CSRFError)
|
@app.errorhandler(CSRFError)
|
||||||
def _csrf_handler():
|
def _csrf_handler(): return jsonify({'error':'Could not validate a secure connection.'}), 403
|
||||||
return jsonify({'error':'Could not validate a secure connection.'}), 403
|
|
||||||
@app.context_processor
|
@app.context_processor
|
||||||
def _now():
|
def _now(): return {'now': datetime.now()}
|
||||||
return {'now': datetime.now()}
|
|
||||||
|
|
||||||
from app.admin.views import admin
|
from app.admin.views import admin
|
||||||
from app.api.views import api
|
from app.api.views import api
|
||||||
|
Loading…
Reference in New Issue
Block a user