Last active
April 17, 2019 10:01
-
-
Save zgohr/4490410 to your computer and use it in GitHub Desktop.
Remove Tastypie from Django admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from tastypie.models import ApiKey, ApiAccess | |
admin.site.unregister(ApiKey) | |
admin.site.unregister(ApiAccess) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I tried this, I got:
django.contrib.admin.sites.NotRegistered: The model ApiKey is not registered
Then I tried registering ApiKey just for fun, and got:
django.contrib.admin.sites.AlreadyRegistered: The model ApiKey is already registered
Eventually I was able to remove api keys from admin by adding the following to my settings.py:
TASTYPIE_ABSTRACT_APIKEY = True
based on this chunk of django-tastypie source.
I'm running the following versions:
Django==1.8.4
django-tastypie==0.12.2