Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Userless Django admin
# Does not fully work, but gets you partially there.
class UserlessAdminSite(admin.sites.AdminSite):
def check_dependencies(self):
pass
def has_permission(self, *args, **kwargs):
return True
class UserlessModelAdmin(admin.ModelAdmin):
def has_add_permission(self, *args, **kwargs):
return True
def has_change_permission(self, *args, **kwargs):
return True
def has_delete_permission(self, *args, **kwargs):
return True
def log_addition(self, *args, **kwargs):
pass
def log_change(self, *args, **kwargs):
pass
def log_deletion(self, *args, **kwargs):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment