Добавил адмнку
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import AccessLog
|
||||
|
||||
|
||||
@admin.register(AccessLog)
|
||||
class AccessLogAdmin(admin.ModelAdmin):
|
||||
list_display = ('timestamp', 'username', 'method', 'path', 'ip_address')
|
||||
list_filter = ('method', 'timestamp')
|
||||
search_fields = ('username', 'path', 'ip_address')
|
||||
readonly_fields = ('timestamp', 'username', 'method', 'path', 'ip_address')
|
||||
ordering = ('-timestamp',)
|
||||
|
||||
def has_add_permission(self, request):
|
||||
return False
|
||||
|
||||
def has_change_permission(self, request, obj=None):
|
||||
return False
|
||||
|
||||
def has_delete_permission(self, request, obj=None):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user