|
| 1 | +{% load staticfiles %} |
| 2 | +<!DOCTYPE html> |
| 3 | +<html lang="en"> |
| 4 | + <head> |
| 5 | + <meta charset="utf-8"> |
| 6 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 | + |
| 9 | + <title>Error Rendering Schema</title> |
| 10 | + </head> |
| 11 | + <body> |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +<h1>Error</h1> |
| 16 | + |
| 17 | +<pre> |
| 18 | +{{ data }} |
| 19 | +</pre> |
| 20 | + |
| 21 | + |
| 22 | +{% if debug is True %} |
| 23 | +<hr /> |
| 24 | +<h2>Additional Information</h2> |
| 25 | +<p>Note: You are seeing this message because <code>DEBUG==True</code>.</p> |
| 26 | + |
| 27 | +<p>Seeing this page is <em>usually</em> a configuration error: are your |
| 28 | +<code>DEFAULT_AUTHENTICATION_CLASSES</code> or <code>DEFAULT_PERMISSION_CLASSES</code> |
| 29 | +being applied unexpectedly?</p> |
| 30 | + |
| 31 | +<p>Your response status code is: <code>{{ response.status_code }}</code></p> |
| 32 | + |
| 33 | +<h3>401 Unauthorised.</h3> |
| 34 | +<ul> |
| 35 | + <li>Do you have SessionAuthentication enabled?</li> |
| 36 | + <li>Are you logged in?</li> |
| 37 | +</ul> |
| 38 | + |
| 39 | + |
| 40 | +<h3>403 Forbidden.</h3> |
| 41 | +<ul> |
| 42 | + <li>Do you have sufficient permissions to access this view?</li> |
| 43 | + <li>Is you schema non-empty? (An empty schema will lead to a permission denied error being raised.)</li> |
| 44 | +</ul> |
| 45 | + |
| 46 | + |
| 47 | +<p>Most commonly the intended solution is to disable authentication and permissions |
| 48 | +when including the docs urls:</p> |
| 49 | + |
| 50 | +<pre> |
| 51 | + url(r'^docs/', include_docs_urls(title='Your API', |
| 52 | + authentication_classes=[], |
| 53 | + permission_classes=[])), |
| 54 | +</pre> |
| 55 | + |
| 56 | + |
| 57 | +<h2>Overriding this template</h2> |
| 58 | + |
| 59 | +<p>If you wish access to your docs to be authenticated you may override this template |
| 60 | +at <code>rest_framework/docs/error.html</code>.</p> |
| 61 | + |
| 62 | +<p>The available context is: <code>data</code> the error dict above, <code>request</code>, |
| 63 | +<code>response</code> and the <code>debug</code> flag.</p> |
| 64 | + |
| 65 | +{% endif %} |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + <script src="{% static 'rest_framework/docs/js/jquery-1.10.2.min.js' %}"></script> |
| 70 | + </body> |
| 71 | +</html> |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
0 commit comments