2012-09-20 16:06:27 +04:00
{% load url from future %}
2012-09-20 16:42:46 +04:00
{% load rest_framework %}
2012-09-20 16:06:27 +04:00
<!DOCTYPE html>
< html >
< head >
2012-09-20 20:44:34 +04:00
{% block head %}
2012-09-20 16:06:27 +04:00
2012-09-20 20:44:34 +04:00
{% block meta %}
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< meta name = "robots" content = "NONE,NOARCHIVE" / >
2012-09-20 16:06:27 +04:00
{% endblock %}
2012-09-20 20:44:34 +04:00
< title > {% block title %}Django REST framework{% endblock %}< / title >
2012-09-20 16:06:27 +04:00
2012-09-20 20:44:34 +04:00
{% block style %}
2013-05-18 16:10:05 +04:00
{% block bootstrap_theme %}
< link rel = "stylesheet" type = "text/css" href = "{% static " rest_framework / css / bootstrap . min . css " % } " / >
< link rel = "stylesheet" type = "text/css" href = "{% static " rest_framework / css / bootstrap-tweaks . css " % } " / >
{% endblock %}
2012-12-27 01:35:03 +04:00
< link rel = "stylesheet" type = "text/css" href = "{% static " rest_framework / css / prettify . css " % } " / >
< link rel = "stylesheet" type = "text/css" href = "{% static " rest_framework / css / default . css " % } " / >
2012-09-20 20:44:34 +04:00
{% endblock %}
2012-09-20 16:06:27 +04:00
2012-09-20 20:44:34 +04:00
{% endblock %}
2012-09-20 16:06:27 +04:00
< / head >
< body class = "{% block bodyclass %}{% endblock %} container" >
2012-10-05 20:00:24 +04:00
< div class = "wrapper" >
2012-09-20 20:44:34 +04:00
{% block navbar %}
2012-10-05 20:00:24 +04:00
< div class = "navbar {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}" >
2012-09-20 16:06:27 +04:00
< div class = "navbar-inner" >
2012-10-05 20:00:24 +04:00
< div class = "container-fluid" >
2013-05-18 16:10:05 +04:00
< span href = "/" >
2014-01-08 19:22:41 +04:00
{% block branding %}< a class = 'brand' rel = "nofollow" href = 'http://www.django-rest-framework.org' > Django REST framework < span class = "version" > {{ version }}< / span > < / a > {% endblock %}
2012-09-20 16:06:27 +04:00
< / span >
< ul class = "nav pull-right" >
{% block userlinks %}
2012-09-20 20:44:34 +04:00
{% if user.is_authenticated %}
2012-09-20 16:06:27 +04:00
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" >
2012-10-09 16:50:26 +04:00
{{ user }}
2012-09-20 16:06:27 +04:00
< b class = "caret" > < / b >
< / a >
< ul class = "dropdown-menu" >
2012-09-20 20:44:34 +04:00
< li > {% optional_logout request %}< / li >
2012-09-20 16:06:27 +04:00
< / ul >
< / li >
{% else %}
2012-09-20 20:44:34 +04:00
< li > {% optional_login request %}< / li >
2012-09-20 16:06:27 +04:00
{% endif %}
{% endblock %}
< / ul >
< / div >
< / div >
< / div >
2012-09-20 20:44:34 +04:00
{% endblock %}
2012-09-20 16:06:27 +04:00
{% block breadcrumbs %}
< ul class = "breadcrumb" >
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
< li >
< a href = "{{ breadcrumb_url }}" { % if forloop . last % } class = "active" { % endif % } > {{ breadcrumb_name }}< / a > {% if not forloop.last %}< span class = "divider" > › < / span > {% endif %}
< / li >
{% endfor %}
< / ul >
{% endblock %}
<!-- Content -->
< div id = "content" >
{% if 'GET' in allowed_methods %}
< form id = "get-form" class = "pull-right" >
< fieldset >
< div class = "btn-group format-selection" >
2012-09-25 16:35:41 +04:00
< a class = "btn btn-primary js-tooltip" href = '{{ request.get_full_path }}' rel = "nofollow" title = "Make a GET request on the {{ name }} resource" > GET< / a >
2012-09-20 16:06:27 +04:00
< button class = "btn btn-primary dropdown-toggle js-tooltip" data-toggle = "dropdown" title = "Specify a format for the GET request" >
< span class = "caret" > < / span >
< / button >
< ul class = "dropdown-menu" >
{% for format in available_formats %}
2012-09-20 20:44:34 +04:00
< li >
2012-09-25 16:35:41 +04:00
< a class = "js-tooltip format-option" href = '{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}' rel = "nofollow" title = "Make a GET request on the {{ name }} resource with the format set to `{{ format }}`" > {{ format }}< / a >
2012-09-20 20:44:34 +04:00
< / li >
2012-09-20 16:06:27 +04:00
{% endfor %}
< / ul >
< / div >
< / fieldset >
< / form >
{% endif %}
2012-09-28 00:51:46 +04:00
{% if options_form %}
2012-09-25 16:35:41 +04:00
< form class = "button-form" action = "{{ request.get_full_path }}" method = "POST" class = "pull-right" >
2012-09-20 16:06:27 +04:00
{% csrf_token %}
< input type = "hidden" name = "{{ api_settings.FORM_METHOD_OVERRIDE }}" value = "OPTIONS" / >
2012-10-09 15:48:49 +04:00
< button class = "btn btn-primary js-tooltip" title = "Make an OPTIONS request on the {{ name }} resource" > OPTIONS< / button >
2012-09-25 16:35:41 +04:00
< / form >
{% endif %}
2012-09-28 00:51:46 +04:00
{% if delete_form %}
2012-09-25 16:35:41 +04:00
< form class = "button-form" action = "{{ request.get_full_path }}" method = "POST" class = "pull-right" >
{% csrf_token %}
< input type = "hidden" name = "{{ api_settings.FORM_METHOD_OVERRIDE }}" value = "DELETE" / >
< button class = "btn btn-danger js-tooltip" title = "Make a DELETE request on the {{ name }} resource" > DELETE< / button >
2012-09-20 16:06:27 +04:00
< / form >
{% endif %}
< div class = "content-main" >
< div class = "page-header" > < h1 > {{ name }}< / h1 > < / div >
2013-10-08 18:15:15 +04:00
{% block description %}
2012-10-29 18:41:33 +04:00
{{ description }}
2013-10-08 18:15:15 +04:00
{% endblock %}
2013-05-18 16:10:05 +04:00
< div class = "request-info" style = "clear: both" >
2012-09-20 16:06:27 +04:00
< pre class = "prettyprint" > < b > {{ request.method }}< / b > {{ request.get_full_path }}< / pre >
2013-01-15 16:46:41 +04:00
< / div >
2012-09-20 16:06:27 +04:00
< div class = "response-info" >
< pre class = "prettyprint" > < div class = "meta nocode" > < b > HTTP {{ response.status_code }} {{ response.status_text }}< / b > {% autoescape off %}
2013-04-04 14:11:04 +04:00
{% for key, val in response.items %}< b > {{ key }}:< / b > < span class = "lit" > {{ val|break_long_headers|urlize_quoted_links }}< / span >
2012-09-20 16:06:27 +04:00
{% endfor %}
< / div > {{ content|urlize_quoted_links }}< / pre > {% endautoescape %}
< / div >
2012-10-05 20:00:24 +04:00
< / div >
2012-09-20 16:06:27 +04:00
2013-09-13 18:54:44 +04:00
{% if display_edit_forms %}
2012-09-20 16:06:27 +04:00
2013-02-22 12:39:26 +04:00
{% if post_form or raw_data_post_form %}
< div { % if post_form % } class = "tabbable" { % endif % } >
{% if post_form %}
2013-02-20 15:15:12 +04:00
< ul class = "nav nav-tabs form-switcher" >
2013-08-29 23:35:59 +04:00
< li > < a name = 'html-tab' href = "#object-form" data-toggle = "tab" > HTML form< / a > < / li >
< li > < a name = 'raw-tab' href = "#generic-content-form" data-toggle = "tab" > Raw data< / a > < / li >
2013-02-15 16:25:36 +04:00
< / ul >
2013-02-22 12:39:26 +04:00
{% endif %}
< div class = "well tab-content" >
2013-02-15 16:25:36 +04:00
{% if post_form %}
< div class = "tab-pane" id = "object-form" >
{% with form=post_form %}
2013-08-23 17:38:31 +04:00
< form action = "{{ request.get_full_path }}" method = "POST" enctype = "multipart/form-data" class = "form-horizontal" >
2013-02-22 12:39:26 +04:00
< fieldset >
2013-08-23 17:38:31 +04:00
{{ post_form }}
2013-02-22 12:39:26 +04:00
< div class = "form-actions" >
< button class = "btn btn-primary" title = "Make a POST request on the {{ name }} resource" > POST< / button >
< / div >
< / fieldset >
< / form >
2013-02-15 16:25:36 +04:00
{% endwith %}
< / div >
{% endif %}
2013-02-22 12:39:26 +04:00
< div { % if post_form % } class = "tab-pane" { % endif % } id = "generic-content-form" >
{% with form=raw_data_post_form %}
< form action = "{{ request.get_full_path }}" method = "POST" class = "form-horizontal" >
< fieldset >
2013-10-02 19:13:34 +04:00
{% include "rest_framework/raw_data_form.html" %}
2013-02-22 12:39:26 +04:00
< div class = "form-actions" >
< button class = "btn btn-primary" title = "Make a POST request on the {{ name }} resource" > POST< / button >
< / div >
< / fieldset >
< / form >
2013-02-15 16:25:36 +04:00
{% endwith %}
< / div >
< / div >
2012-10-03 19:19:07 +04:00
< / div >
2012-09-20 16:06:27 +04:00
{% endif %}
2013-02-22 12:39:26 +04:00
{% if put_form or raw_data_put_form or raw_data_patch_form %}
< div { % if put_form % } class = "tabbable" { % endif % } >
{% if put_form %}
2013-02-20 15:15:12 +04:00
< ul class = "nav nav-tabs form-switcher" >
2013-08-29 23:38:55 +04:00
< li > < a name = 'html-tab' href = "#object-form" data-toggle = "tab" > HTML form< / a > < / li >
< li > < a name = 'raw-tab' href = "#generic-content-form" data-toggle = "tab" > Raw data< / a > < / li >
2013-02-15 12:41:12 +04:00
< / ul >
2013-02-22 12:39:26 +04:00
{% endif %}
< div class = "well tab-content" >
2013-02-15 12:41:12 +04:00
{% if put_form %}
< div class = "tab-pane" id = "object-form" >
2013-08-23 17:38:31 +04:00
< form action = "{{ request.get_full_path }}" method = "POST" enctype = "multipart/form-data" class = "form-horizontal" >
2013-02-22 12:39:26 +04:00
< fieldset >
2013-08-23 17:38:31 +04:00
{{ put_form }}
2013-02-22 12:39:26 +04:00
< div class = "form-actions" >
< button class = "btn btn-primary js-tooltip" name = "{{ api_settings.FORM_METHOD_OVERRIDE }}" value = "PUT" title = "Make a PUT request on the {{ name }} resource" > PUT< / button >
< / div >
< / fieldset >
< / form >
2013-02-15 12:41:12 +04:00
< / div >
{% endif %}
2013-02-22 12:39:26 +04:00
< div { % if put_form % } class = "tab-pane" { % endif % } id = "generic-content-form" >
{% with form=raw_data_put_or_patch_form %}
< form action = "{{ request.get_full_path }}" method = "POST" class = "form-horizontal" >
< fieldset >
2013-10-02 19:13:34 +04:00
{% include "rest_framework/raw_data_form.html" %}
2013-02-22 12:39:26 +04:00
< div class = "form-actions" >
{% if raw_data_put_form %}
< button class = "btn btn-primary js-tooltip" name = "{{ api_settings.FORM_METHOD_OVERRIDE }}" value = "PUT" title = "Make a PUT request on the {{ name }} resource" > PUT< / button >
{% endif %}
{% if raw_data_patch_form %}
2013-08-12 16:41:48 +04:00
< button class = "btn btn-primary js-tooltip" name = "{{ api_settings.FORM_METHOD_OVERRIDE }}" value = "PATCH" title = "Make a PATCH request on the {{ name }} resource" > PATCH< / button >
2013-02-22 12:39:26 +04:00
{% endif %}
< / div >
< / fieldset >
< / form >
2013-02-15 12:41:12 +04:00
{% endwith %}
< / div >
< / div >
2012-10-03 19:19:07 +04:00
< / div >
2012-09-20 16:06:27 +04:00
{% endif %}
{% endif %}
< / div >
<!-- END content - main -->
< / div >
<!-- END Content -->
2012-10-05 20:00:24 +04:00
< div id = "push" > < / div >
< / div >
< / div > <!-- ./wrapper -->
2012-09-20 20:44:34 +04:00
{% block footer %}
{% endblock %}
{% block script %}
2012-12-27 01:35:03 +04:00
< script src = "{% static " rest_framework / js / jquery-1 . 8 . 1-min . js " % } " > < / script >
< script src = "{% static " rest_framework / js / bootstrap . min . js " % } " > < / script >
< script src = "{% static " rest_framework / js / prettify-min . js " % } " > < / script >
< script src = "{% static " rest_framework / js / default . js " % } " > < / script >
2012-09-20 20:44:34 +04:00
{% endblock %}
2012-09-20 16:06:27 +04:00
< / body >
< / html >