Hello, I'm trying to override the default admin site to add some elements (basically menu items to custom pages).
I followed the latest documentation, and it seems to be working except that when accessing the administration I'm being told :
You don’t have permission to view or edit anything.
Which is weird because I still have the "LogEntry" block with my last actions. And I can see that I'm logged with the super-user account.
I've tried re-logging, but it doesn't help.
Below are the relevant lines of code I believe.
# project/admin.py
class CustomAdminSite(admin.AdminSite):
site_header = 'Ascension - Administration' # Customize the header text
site_title = 'Ascension - Administration' # Customize the browser tab title
index_title = 'Game administration'
custom_admin_site = CustomAdminSite()
# project/apps.py
from django.contrib.admin import apps
class CustomAdminConfig(apps.AdminConfig):
default_site = "admin.CustomAdminSite"
# project/urls.py
from admin import CustomAdminSite
custom_admin_site = CustomAdminSite()
urlpatterns = [
path('', RedirectView.as_view(url='/admin')),
path('admin', custom_admin_site.urls),
# path('admin', admin.site.urls),
] + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
# project/settings.py
INSTALLED_APPS = [
'ascension',
'apps.CustomAdminConfig',
# 'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
If anything more is needed please let me know.
Thank you for your time.