api.html 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. {% extends 'rest_framework/base.html' %}
  2. {% load static %}
  3. {% load i18n %}
  4. {% block head %}
  5. {{ block.super }}
  6. <link rel="icon" type="image/png" href="{% static 'rest-api.ico' %}" />
  7. {% endblock head %}
  8. {% block script %}
  9. {# Copies the upstream DRF script block to add CSP nonces: re-sync it when djangorestframework is upgraded. #}
  10. <script type="application/json" id="drf_csrf" nonce="{{ csp_nonce }}">
  11. {
  12. "csrfHeaderName": "{{ csrf_header_name|default:'X-CSRFToken' }}",
  13. "csrfToken": "{% if request %}{{ csrf_token }}{% endif %}"
  14. }
  15. </script>
  16. <script src="{% static 'rest_framework/js/jquery-3.7.1.min.js' %}" nonce="{{ csp_nonce }}"></script>
  17. <script src="{% static 'rest_framework/js/ajax-form.js' %}" nonce="{{ csp_nonce }}"></script>
  18. <script src="{% static 'rest_framework/js/csrf.js' %}" nonce="{{ csp_nonce }}"></script>
  19. <script src="{% static 'rest_framework/js/bootstrap.min.js' %}" nonce="{{ csp_nonce }}"></script>
  20. <script src="{% static 'rest_framework/js/prettify-min.js' %}" nonce="{{ csp_nonce }}"></script>
  21. <script src="{% static 'rest_framework/js/default.js' %}" nonce="{{ csp_nonce }}"></script>
  22. <script src="{% static 'rest_framework/js/load-ajax-form.js' %}" nonce="{{ csp_nonce }}"></script>
  23. {% endblock script %}
  24. {% block title %}{% if name %}{{ name }} | {% endif %}NetBox {% trans "REST API" %}{% endblock %}
  25. {% block branding %}
  26. <a class="navbar-brand" href="{% url 'home' %}">NetBox</a>
  27. {% endblock branding %}