Skip to content

API logs graph not appearing in Django admin when using custom admin site #109

Description

@jamesflores

Hello,

I'm using a custom admin site to extend the Django admin login form with a Google reCaptcha. Before I added this, the APIRequestLog was automatically registered and I didn't have to provide the code below. However, now I cannot see the datepicker or bar graph. Can anyone help with getting this back whilst using my custom admin site?

admin.py:

class APIRequestLogAdmin(admin.ModelAdmin):
    list_display = ('requested_at', 'response_ms', 'path', 'remote_addr', 'host', 'method', 'query_params', 'data', 'errors', 'user', 'user_agent')

class CustomAdminSite(admin.AdminSite):
    login_form = CustomAdminLoginForm

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._registry.update(admin.site._registry)

admin_site = CustomAdminSite(name='admin')
admin_site.register(APIRequestLog, APIRequestLogAdmin)

image

Thanks,
James

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions