mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Links to source files in docs
This commit is contained in:
parent
5d9dfcd8ae
commit
247696e820
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="authentication.py"></a>
|
||||||
|
|
||||||
# Authentication
|
# Authentication
|
||||||
|
|
||||||
Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with. The [permission] and [throttling] policies can then use those credentials to determine if the request should be permitted.
|
Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with. The [permission] and [throttling] policies can then use those credentials to determine if the request should be permitted.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="exceptions.py"></a>
|
||||||
|
|
||||||
# Exceptions
|
# Exceptions
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="parsers.py"></a>
|
||||||
|
|
||||||
# Parsers
|
# Parsers
|
||||||
|
|
||||||
## .parse(request)
|
## .parse(request)
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
<a class="github" href="permissions.py"></a>
|
||||||
|
|
||||||
|
# Permissions
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="renderers.py"></a>
|
||||||
|
|
||||||
# Renderers
|
# Renderers
|
||||||
|
|
||||||
## .render(response)
|
## .render(response)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="request.py"></a>
|
||||||
|
|
||||||
# Requests
|
# Requests
|
||||||
|
|
||||||
> If you're doing REST-based web service stuff ... you should ignore request.POST.
|
> If you're doing REST-based web service stuff ... you should ignore request.POST.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="response.py"></a>
|
||||||
|
|
||||||
# Responses
|
# Responses
|
||||||
|
|
||||||
> Unlike basic HttpResponse objects, TemplateResponse objects retain the details of the context that was provided by the view to compute the response. The final output of the response is not computed until it is needed, later in the response process.
|
> Unlike basic HttpResponse objects, TemplateResponse objects retain the details of the context that was provided by the view to compute the response. The final output of the response is not computed until it is needed, later in the response process.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="reverse.py"></a>
|
||||||
|
|
||||||
# Returning URIs from your Web APIs
|
# Returning URIs from your Web APIs
|
||||||
|
|
||||||
> The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.
|
> The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="serializers.py"></a>
|
||||||
|
|
||||||
# Serializers
|
# Serializers
|
||||||
|
|
||||||
> Expanding the usefulness of the serializers is something that we would
|
> Expanding the usefulness of the serializers is something that we would
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="settings.py"></a>
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
|
|
||||||
Configuration for REST framework is all namespaced inside the `API_SETTINGS` setting.
|
Configuration for REST framework is all namespaced inside the `API_SETTINGS` setting.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="status.py"></a>
|
||||||
|
|
||||||
# Status Codes
|
# Status Codes
|
||||||
|
|
||||||
> 418 I'm a teapot - Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
|
> 418 I'm a teapot - Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
<a class="github" href="throttling.py"></a>
|
||||||
|
|
||||||
|
# Throttling
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<a class="github" href="views.py"></a>
|
||||||
|
|
||||||
> Django's class based views are a welcome departure from the old-style views.
|
> Django's class based views are a welcome departure from the old-style views.
|
||||||
>
|
>
|
||||||
> — [Reinout van Rees][cite]
|
> — [Reinout van Rees][cite]
|
||||||
|
|
12
docs/static/css/drf-styles.css
vendored
12
docs/static/css/drf-styles.css
vendored
|
@ -14,6 +14,14 @@ pre {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.github {
|
||||||
|
float: right;
|
||||||
|
margin-top: -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.github:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* Preserve the spacing of the navbar across different screen sizes. */
|
/* Preserve the spacing of the navbar across different screen sizes. */
|
||||||
.navbar-inner {
|
.navbar-inner {
|
||||||
|
@ -66,7 +74,7 @@ blockquote {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote:before {
|
blockquote:before {
|
||||||
display: block;
|
display: block;
|
||||||
content: "\201C";
|
content: "\201C";
|
||||||
font-size: 80px;
|
font-size: 80px;
|
||||||
|
@ -76,7 +84,7 @@ blockquote {
|
||||||
color: #7a7a7a;
|
color: #7a7a7a;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote p:last-child {
|
blockquote p:last-child {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -24,6 +24,7 @@ else:
|
||||||
|
|
||||||
main_header = '<li class="main"><a href="#{{ anchor }}">{{ title }}</a></li>'
|
main_header = '<li class="main"><a href="#{{ anchor }}">{{ title }}</a></li>'
|
||||||
sub_header = '<li><a href="#{{ anchor }}">{{ title }}</a></li>'
|
sub_header = '<li><a href="#{{ anchor }}">{{ title }}</a></li>'
|
||||||
|
code_label = r'<a class="github" href="https://github.com/tomchristie/django-rest-framework/blob/restframework2/djangorestframework/\1"><span class="label label-info">\1</span></a>'
|
||||||
|
|
||||||
page = open(os.path.join(docs_dir, 'template.html'), 'r').read()
|
page = open(os.path.join(docs_dir, 'template.html'), 'r').read()
|
||||||
|
|
||||||
|
@ -68,4 +69,5 @@ for (dirpath, dirnames, filenames) in os.walk(docs_dir):
|
||||||
output = re.sub(r'a href="([^"]*)\.md"', r'a href="\1%s"' % suffix, output)
|
output = re.sub(r'a href="([^"]*)\.md"', r'a href="\1%s"' % suffix, output)
|
||||||
output = re.sub(r'<pre><code>:::bash', r'<pre class="prettyprint lang-bsh">', output)
|
output = re.sub(r'<pre><code>:::bash', r'<pre class="prettyprint lang-bsh">', output)
|
||||||
output = re.sub(r'<pre>', r'<pre class="prettyprint lang-py">', output)
|
output = re.sub(r'<pre>', r'<pre class="prettyprint lang-py">', output)
|
||||||
|
output = re.sub(r'<a class="github" href="([^"]*)"></a>', code_label, output)
|
||||||
open(build_file, 'w').write(output.encode('utf-8'))
|
open(build_file, 'w').write(output.encode('utf-8'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user