2011-01-24 02:08:16 +03:00
|
|
|
{% load urlize_quoted_links %}{% load add_query_param %}<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
2011-02-19 13:26:27 +03:00
|
|
|
<style>
|
|
|
|
/* Override some of the Django admin styling */
|
|
|
|
#site-name a {color: #F4F379 !important;}
|
|
|
|
.errorlist {display: inline !important}
|
|
|
|
.errorlist li {display: inline !important; background: white !important; color: black !important; border: 0 !important;}
|
2011-06-26 01:07:06 +04:00
|
|
|
/* Custom styles */
|
|
|
|
.version{font-size:8px;}
|
2011-02-19 13:26:27 +03:00
|
|
|
</style>
|
|
|
|
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/base.css'/>
|
|
|
|
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/forms.css'/>
|
|
|
|
<title>Django REST framework - {{ name }}</title>
|
2011-01-24 02:08:16 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
2011-02-19 13:26:27 +03:00
|
|
|
<div id="container">
|
|
|
|
|
|
|
|
<div id="header">
|
|
|
|
<div id="branding">
|
2011-06-26 01:07:06 +04:00
|
|
|
<h1 id="site-name"><a href='http://django-rest-framework.org'>Django REST framework</a> <span class="version"> v {{ version }}</span></h1>
|
2011-02-19 13:26:27 +03:00
|
|
|
</div>
|
|
|
|
<div id="user-tools">
|
|
|
|
{% if user.is_active %}Welcome, {{ user }}.{% if logout_url %} <a href='{{ logout_url }}'>Log out</a>{% endif %}{% else %}Anonymous {% if login_url %}<a href='{{ login_url }}'>Log in</a>{% endif %}{% endif %}
|
|
|
|
</div>
|
2011-01-24 02:08:16 +03:00
|
|
|
</div>
|
2011-02-19 13:26:27 +03:00
|
|
|
|
|
|
|
<div class="breadcrumbs">
|
|
|
|
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
|
|
|
|
<a href="{{breadcrumb_url}}">{{breadcrumb_name}}</a> {% if not forloop.last %}›{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="content" class="{% block coltype %}colM{% endblock %}">
|
|
|
|
|
|
|
|
<div class='content-main'>
|
|
|
|
<h1>{{ name }}</h1>
|
|
|
|
<p>{% if markeddown %}{% autoescape off %}{{ markeddown }}{% endautoescape %}{% else %}{{ description|linebreaksbr }}{% endif %}</p>
|
|
|
|
<div class='module'>
|
2011-01-28 00:09:25 +03:00
|
|
|
<pre><b>{{ response.status }} {{ response.status_text }}</b>{% autoescape off %}
|
2011-01-28 20:42:57 +03:00
|
|
|
{% for key, val in response.headers.items %}<b>{{ key }}:</b> {{ val|urlize_quoted_links }}
|
|
|
|
{% endfor %}
|
2011-02-19 13:26:27 +03:00
|
|
|
{{ content|urlize_quoted_links }}</pre>{% endautoescape %}</div>
|
|
|
|
|
2011-05-12 18:11:14 +04:00
|
|
|
{% if 'GET' in view.allowed_methods %}
|
2011-02-19 13:26:27 +03:00
|
|
|
<form>
|
|
|
|
<fieldset class='module aligned'>
|
|
|
|
<h2>GET {{ name }}</h2>
|
|
|
|
<div class='submit-row' style='margin: 0; border: 0'>
|
2011-05-31 17:40:30 +04:00
|
|
|
<a href='{{ request.get_full_path }}' rel="nofollow" style='float: left'>GET</a>
|
2011-06-26 18:03:36 +04:00
|
|
|
{% for format in available_formats %}
|
|
|
|
{% with FORMAT_PARAM|add:"="|add:format as param %}
|
|
|
|
[<a href='{{ request.get_full_path|add_query_param:param }}' rel="nofollow">{{ format }}</a>]
|
2011-02-19 13:26:27 +03:00
|
|
|
{% endwith %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
2011-01-24 02:08:16 +03:00
|
|
|
{% endif %}
|
|
|
|
|
2011-06-26 03:32:27 +04:00
|
|
|
{# Only display the POST/PUT/DELETE forms if method tunneling via POST forms is enabled and the user has permissions on this view. #}
|
|
|
|
{% if METHOD_PARAM and response.status != 403 %}
|
2011-05-27 17:40:19 +04:00
|
|
|
|
2011-05-12 18:11:14 +04:00
|
|
|
{% if 'POST' in view.allowed_methods %}
|
2011-05-31 17:40:30 +04:00
|
|
|
<form action="{{ request.get_full_path }}" method="post" {% if post_form.is_multipart %}enctype="multipart/form-data"{% endif %}>
|
2011-02-19 13:26:27 +03:00
|
|
|
<fieldset class='module aligned'>
|
|
|
|
<h2>POST {{ name }}</h2>
|
2011-01-28 00:09:25 +03:00
|
|
|
{% csrf_token %}
|
2011-05-27 17:40:19 +04:00
|
|
|
{{ post_form.non_field_errors }}
|
|
|
|
{% for field in post_form %}
|
2011-02-19 13:26:27 +03:00
|
|
|
<div class='form-row'>
|
|
|
|
{{ field.label_tag }}
|
2011-01-28 00:09:25 +03:00
|
|
|
{{ field }}
|
2011-02-19 13:26:27 +03:00
|
|
|
<span class='help'>{{ field.help_text }}</span>
|
2011-01-28 00:09:25 +03:00
|
|
|
{{ field.errors }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2011-02-19 13:26:27 +03:00
|
|
|
<div class='submit-row' style='margin: 0; border: 0'>
|
|
|
|
<input type="submit" value="POST" class="default" />
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2011-01-28 00:09:25 +03:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
2011-05-12 18:11:14 +04:00
|
|
|
{% if 'PUT' in view.allowed_methods %}
|
2011-05-31 17:40:30 +04:00
|
|
|
<form action="{{ request.get_full_path }}" method="post" {% if put_form.is_multipart %}enctype="multipart/form-data"{% endif %}>
|
2011-02-19 13:26:27 +03:00
|
|
|
<fieldset class='module aligned'>
|
|
|
|
<h2>PUT {{ name }}</h2>
|
2011-05-12 18:11:14 +04:00
|
|
|
<input type="hidden" name="{{ METHOD_PARAM }}" value="PUT" />
|
2011-01-28 00:09:25 +03:00
|
|
|
{% csrf_token %}
|
2011-05-27 17:40:19 +04:00
|
|
|
{{ put_form.non_field_errors }}
|
|
|
|
{% for field in put_form %}
|
2011-02-19 13:26:27 +03:00
|
|
|
<div class='form-row'>
|
|
|
|
{{ field.label_tag }}
|
2011-01-28 00:09:25 +03:00
|
|
|
{{ field }}
|
2011-02-19 13:26:27 +03:00
|
|
|
<span class='help'>{{ field.help_text }}</span>
|
2011-01-28 00:09:25 +03:00
|
|
|
{{ field.errors }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2011-02-19 13:26:27 +03:00
|
|
|
<div class='submit-row' style='margin: 0; border: 0'>
|
|
|
|
<input type="submit" value="PUT" class="default" />
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2011-01-28 00:09:25 +03:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
2011-05-12 18:11:14 +04:00
|
|
|
{% if 'DELETE' in view.allowed_methods %}
|
2011-05-31 17:40:30 +04:00
|
|
|
<form action="{{ request.get_full_path }}" method="post">
|
2011-02-19 13:26:27 +03:00
|
|
|
<fieldset class='module aligned'>
|
|
|
|
<h2>DELETE {{ name }}</h2>
|
2011-01-28 00:09:25 +03:00
|
|
|
{% csrf_token %}
|
2011-05-12 18:11:14 +04:00
|
|
|
<input type="hidden" name="{{ METHOD_PARAM }}" value="DELETE" />
|
2011-02-19 13:26:27 +03:00
|
|
|
<div class='submit-row' style='margin: 0; border: 0'>
|
|
|
|
<input type="submit" value="DELETE" class="default" />
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2011-01-28 00:09:25 +03:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
2011-05-27 17:40:19 +04:00
|
|
|
|
2011-01-24 02:08:16 +03:00
|
|
|
{% endif %}
|
2011-01-28 00:09:25 +03:00
|
|
|
</div>
|
2011-02-19 13:26:27 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2011-01-24 02:08:16 +03:00
|
|
|
</body>
|
2011-06-26 18:03:36 +04:00
|
|
|
</html>
|