mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
show token for token auth on browseable api page
This commit is contained in:
parent
42a2a5ef87
commit
d1802b0a9f
|
@ -70,6 +70,7 @@
|
|||
<!-- Content -->
|
||||
<div id="content">
|
||||
|
||||
|
||||
{% if 'GET' in allowed_methods %}
|
||||
<form id="get-form" class="pull-right">
|
||||
<fieldset>
|
||||
|
@ -111,6 +112,17 @@
|
|||
<div class="content-main">
|
||||
<div class="page-header"><h1>{{ name }}</h1></div>
|
||||
{{ description }}
|
||||
{% if user.auth_token.key %}
|
||||
<input class="input-xxlarge" type="text" value="{{ user.auth_token.key}}" name="key" size="40" onclick="this.select()" />
|
||||
<label class="help-inline" for="key">API Key</label>
|
||||
<span class="help-block">
|
||||
To use Token Authentication append the token into a GET variable named "token" or add
|
||||
to the Authentization header as shown below:
|
||||
</span>
|
||||
<pre class="prettyprint">Authorization: Token {{ user.auth_token.key }}</pre>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div class="request-info" style="clear: both" >
|
||||
<pre class="prettyprint"><b>{{ request.method }}</b> {{ request.get_full_path }}</pre>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user