mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-18 12:30:58 +03:00
Merge pull request #976 from gertjanol/add-tokenadmin-model
Add an ModelAdmin for easy management of Tokens
This commit is contained in:
commit
bafc06e19c
11
rest_framework/authtoken/admin.py
Normal file
11
rest_framework/authtoken/admin.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
from .models import Token
|
||||||
|
|
||||||
|
|
||||||
|
class TokenAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ('key', 'user', 'created')
|
||||||
|
fields = ('user',)
|
||||||
|
ordering = ('-created',)
|
||||||
|
|
||||||
|
|
||||||
|
admin.site.register(Token, TokenAdmin)
|
Loading…
Reference in New Issue
Block a user