mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-03-25 09:43:43 -04:00
- Implemented API key creation, deletion, and display functionality. - Updated the settings page to fetch and show existing API keys. - Added UI elements for creating new API keys and copying them to clipboard. - Enhanced request handling to ensure proper trailing slashes for API endpoints.
15 lines
496 B
Python
15 lines
496 B
Python
from django.contrib import admin
|
|
from allauth.account.decorators import secure_admin_login
|
|
from django.contrib.sessions.models import Session
|
|
from users.models import APIKey
|
|
|
|
admin.autodiscover()
|
|
admin.site.login = secure_admin_login(admin.site.login)
|
|
|
|
class SessionAdmin(admin.ModelAdmin):
|
|
def _session_data(self, obj):
|
|
return obj.get_decoded()
|
|
list_display = ['session_key', '_session_data', 'expire_date']
|
|
|
|
admin.site.register(APIKey)
|
|
admin.site.register(Session, SessionAdmin) |