File tree 5 files changed +26
-26
lines changed
rest_framework/templates/rest_framework
5 files changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -244,19 +244,19 @@ <h4 class="modal-title" id="myModalLabel">{{ error_title }}</h4>
244
244
{% endif %}
245
245
246
246
{% block script %}
247
- < script type ="application/json " id ="drf_csrf ">
247
+ < script type ="application/json " id ="drf_csrf " nonce =" {{ request.csp_nonce }} " >
248
248
{
249
249
"csrfHeaderName" : "{{ csrf_header_name|default:'X-CSRFToken' }}" ,
250
250
"csrfToken" : "{{ csrf_token }}"
251
251
}
252
252
</ script >
253
- < script src ="{% static "rest_framework /js/jquery-3.7.1.min.js" %}"> </ script >
254
- < script src ="{% static "rest_framework /js/ajax-form.js" %}"> </ script >
255
- < script src ="{% static "rest_framework /js/csrf.js" %}"> </ script >
256
- < script src ="{% static "rest_framework /js/bootstrap.min.js" %}"> </ script >
257
- < script src ="{% static "rest_framework /js/prettify-min.js" %}"> </ script >
258
- < script src ="{% static "rest_framework /js/default.js" %}"> </ script >
259
- < script src ="{% static "rest_framework /js/load-ajax-form.js" %}"> </ script >
253
+ < script src ="{% static "rest_framework /js/jquery-3.7.1.min.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
254
+ < script src ="{% static "rest_framework /js/ajax-form.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
255
+ < script src ="{% static "rest_framework /js/csrf.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
256
+ < script src ="{% static "rest_framework /js/bootstrap.min.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
257
+ < script src ="{% static "rest_framework /js/prettify-min.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
258
+ < script src ="{% static "rest_framework /js/default.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
259
+ < script src ="{% static "rest_framework /js/load-ajax-form.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
260
260
{% endblock %}
261
261
</ body >
262
262
{% endblock %}
Original file line number Diff line number Diff line change @@ -287,19 +287,19 @@ <h1>{{ name }}</h1>
287
287
{% endif %}
288
288
289
289
{% block script %}
290
- < script type ="application/json " id ="drf_csrf ">
290
+ < script type ="application/json " id ="drf_csrf " nonce =" {{ request.csp_nonce }} " >
291
291
{
292
292
"csrfHeaderName" : "{{ csrf_header_name|default:'X-CSRFToken' }}" ,
293
293
"csrfToken" : "{% if request %}{{ csrf_token }}{% endif %}"
294
294
}
295
295
</ script >
296
- < script src ="{% static "rest_framework /js/jquery-3.7.1.min.js" %}"> </ script >
297
- < script src ="{% static "rest_framework /js/ajax-form.js" %}"> </ script >
298
- < script src ="{% static "rest_framework /js/csrf.js" %}"> </ script >
299
- < script src ="{% static "rest_framework /js/bootstrap.min.js" %}"> </ script >
300
- < script src ="{% static "rest_framework /js/prettify-min.js" %}"> </ script >
301
- < script src ="{% static "rest_framework /js/default.js" %}"> </ script >
302
- < script src ="{% static "rest_framework /js/load-ajax-form.js" %}"> </ script >
296
+ < script src ="{% static "rest_framework /js/jquery-3.7.1.min.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
297
+ < script src ="{% static "rest_framework /js/ajax-form.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
298
+ < script src ="{% static "rest_framework /js/csrf.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
299
+ < script src ="{% static "rest_framework /js/bootstrap.min.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
300
+ < script src ="{% static "rest_framework /js/prettify-min.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
301
+ < script src ="{% static "rest_framework /js/default.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
302
+ < script src ="{% static "rest_framework /js/load-ajax-form.js" %}" nonce=" {{ request.csp_nonce }} " > </ script >
303
303
{% endblock %}
304
304
305
305
</ body >
Original file line number Diff line number Diff line change @@ -66,6 +66,6 @@ <h2>Overriding this template</h2>
66
66
67
67
68
68
69
- < script src ="{% static 'rest_framework/js/jquery-3.7.1.min.js' %} "> </ script >
69
+ < script src ="{% static 'rest_framework/js/jquery-3.7.1.min.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
70
70
</ body >
71
71
</ html >
Original file line number Diff line number Diff line change 17
17
< link href ="{% static 'rest_framework/docs/img/favicon.ico' %} " rel ="shortcut icon ">
18
18
19
19
{% if code_style %}< style > {{ code_style }}</ style > {% endif %}
20
- < script src ="{% static 'rest_framework/js/coreapi-0.1.1.js' %} "> </ script >
21
- < script src ="{% url 'api-docs:schema-js' %} "> </ script >
20
+ < script src ="{% static 'rest_framework/js/coreapi-0.1.1.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
21
+ < script src ="{% url 'api-docs:schema-js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
22
22
23
23
</ head >
24
24
38
38
{% include "rest_framework/docs/auth/basic.html" %}
39
39
{% include "rest_framework/docs/auth/session.html" %}
40
40
41
- < script src ="{% static 'rest_framework/js/jquery-3.7.1.min.js' %} "> </ script >
42
- < script src ="{% static 'rest_framework/js/bootstrap.min.js' %} "> </ script >
43
- < script src ="{% static 'rest_framework/docs/js/jquery.json-view.min.js' %} "> </ script >
44
- < script src ="{% static 'rest_framework/docs/js/api.js' %} "> </ script >
45
- < script >
41
+ < script src ="{% static 'rest_framework/js/jquery-3.7.1.min.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
42
+ < script src ="{% static 'rest_framework/js/bootstrap.min.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
43
+ < script src ="{% static 'rest_framework/docs/js/jquery.json-view.min.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
44
+ < script src ="{% static 'rest_framework/docs/js/api.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
45
+ < script nonce =" {{ request.csp_nonce }} " >
46
46
{ % if user . is_authenticated % }
47
47
window . auth = {
48
48
'type' : 'session' ,
Original file line number Diff line number Diff line change 1
1
{% load rest_framework %}
2
2
{% load static %}
3
3
< pre class ="highlight javascript hide " data-language ="javascript "> < code > {% code html %}<!-- Load the JavaScript client library -->
4
- < script src ="{% static 'rest_framework/js/coreapi-0.1.1.js' %} "> </ script >
5
- < script src ="{% url 'api-docs:schema-js' %} "> </ script > {% endcode %}</ code > </ pre >
4
+ < script src ="{% static 'rest_framework/js/coreapi-0.1.1.js' %} " nonce =" {{ request.csp_nonce }} " > </ script >
5
+ < script src ="{% url 'api-docs:schema-js' %} " nonce =" {{ request.csp_nonce }} " > </ script > {% endcode %}</ code > </ pre >
You can’t perform that action at this time.
0 commit comments