{"id":4502,"library":"django-adminplus","title":"Django Admin Plus","description":"AdminPlus is a Django admin panel extension that allows you to add custom views not tied to models, extending the built-in admin without replacing it entirely. It supports Django versions 3.0+ and Python 3.7+. While the last official PyPI release was in 2016 (v0.6), the project is actively maintained with CI/CD testing against recent Django and Python versions.","status":"active","version":"0.6","language":"en","source_language":"en","source_url":"https://github.com/jsocol/django-adminplus","tags":["django","admin","extension","custom views","web development"],"install":[{"cmd":"pip install django-adminplus","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core web framework dependency; requires Django 3.0+.","package":"Django","optional":false}],"imports":[{"note":"AdminSitePlus is a custom class provided by django-adminplus, not part of Django's core admin.","wrong":"from django.contrib.admin.sites import AdminSitePlus","symbol":"AdminSitePlus","correct":"from adminplus.sites import AdminSitePlus"},{"note":"While the positional argument for view might work, using keyword arguments for 'view' and 'name' is clearer and robust, especially if more arguments are added in the future. Also, ensure 'admin.site' has been replaced with AdminSitePlus first.","wrong":"admin.site.register_view('somepath', my_view)","symbol":"admin.site.register_view","correct":"admin.site.register_view('somepath', view=my_view, name='My View Name')"}],"quickstart":{"code":"import os\nimport django\nfrom django.conf import settings\nfrom django.urls import path, include\nfrom django.contrib import admin\nfrom adminplus.sites import AdminSitePlus\nfrom django.http import HttpResponse\n\nsettings.configure(\n    DEBUG=True,\n    SECRET_KEY=os.environ.get('DJANGO_SECRET_KEY', 'insecure-dev-key'),\n    ROOT_URLCONF=__name__,\n    INSTALLED_APPS=[\n        'django.contrib.admin.apps.SimpleAdminConfig', # Replace default admin config\n        'django.contrib.auth',\n        'django.contrib.contenttypes',\n        'django.contrib.sessions',\n        'django.contrib.messages',\n        'django.contrib.staticfiles',\n        'adminplus',\n    ],\n    TEMPLATES=[\n        {\n            'BACKEND': 'django.template.backends.django.DjangoTemplates',\n            'DIRS': [],\n            'APP_DIRS': True,\n            'OPTIONS': {\n                'context_processors': [\n                    'django.template.context_processors.debug',\n                    'django.template.context_processors.request',\n                    'django.contrib.auth.context_processors.auth',\n                    'django.contrib.messages.context_processors.messages',\n                ],\n            },\n        },\n    ],\n    MIDDLEWARE_CLASSES=[\n        'django.middleware.security.SecurityMiddleware',\n        'django.contrib.sessions.middleware.SessionMiddleware',\n        'django.middleware.common.CommonMiddleware',\n        'django.middleware.csrf.CsrfViewMiddleware',\n        'django.contrib.auth.middleware.AuthenticationMiddleware',\n        'django.contrib.messages.middleware.MessageMiddleware',\n        'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    ],\n    DATABASES={\n        'default': {\n            'ENGINE': 'django.db.backends.sqlite3',\n            'NAME': ':memory:',\n        }\n    },\n    STATIC_URL='/static/',\n)\n\ndjango.setup()\n\n# 1. Replace the default admin.site with AdminSitePlus\nadmin.site = AdminSitePlus()\nadmin.autodiscover()\n\n# 2. Define your custom view\ndef my_custom_admin_view(request):\n    return HttpResponse(\"Hello from a custom admin view!\")\n\n# 3. Register the custom view\nadmin.site.register_view('my-path', view=my_custom_admin_view, name='My Custom View')\n\n# Include the admin URLs\nurlpatterns = [\n    path('admin/', admin.site.urls),\n]\n\nif __name__ == '__main__':\n    # This block is for demonstration only and assumes a Django project setup\n    # In a real project, you would run `python manage.py runserver`\n    print(\"Django Admin Plus quickstart configured.\")\n    print(\"To run, you'd typically have this in your project's urls.py and settings.py.\")\n    print(\"Access custom view at: /admin/my-path/\")","lang":"python","description":"To integrate `django-adminplus`, you need to modify your project's `settings.py` and `urls.py`. In `settings.py`, replace `'django.contrib.admin'` with `'django.contrib.admin.apps.SimpleAdminConfig'` and add `'adminplus'` to `INSTALLED_APPS`. In `urls.py`, replace `django.contrib.admin.site` with an instance of `AdminSitePlus` before calling `admin.autodiscover()`. Then, you can register any callable view using `admin.site.register_view`."},"warnings":[{"fix":"Ensure `admin.site = AdminSitePlus()` is called early in your `urls.py` (before `admin.autodiscover()`) and test thoroughly. If other apps are affected, consider their compatibility with this change.","message":"Replacing `django.contrib.admin.site` is mandatory for `django-adminplus` to function. If you have other packages or custom code that relies on directly manipulating `django.contrib.admin.site` after it's been instantiated, this replacement might cause conflicts or unexpected behavior.","severity":"breaking","affected_versions":"All versions"},{"fix":"In your `settings.py`, ensure `INSTALLED_APPS` contains `'django.contrib.admin.apps.SimpleAdminConfig'` and `'adminplus'` in the correct order as shown in the quickstart example.","message":"Failure to correctly configure `INSTALLED_APPS` by replacing `'django.contrib.admin'` with `'django.contrib.admin.apps.SimpleAdminConfig'` and including `'adminplus'` can lead to custom views not appearing or the default Django admin overriding `django-adminplus` functionality.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Monitor the `django-adminplus` GitHub repository for updates and test thoroughly when upgrading to new major Django versions. Be prepared to contribute patches or temporarily freeze Django versions if critical incompatibilities arise.","message":"While `django-adminplus` version 0.6 is officially old (2016), its GitHub repository shows active CI testing against recent Django (3.2, 4.x, 5.0) and Python (3.8-3.12) versions. However, significant future changes in Django's internal admin structure could introduce compatibility issues not yet reflected in a new release.","severity":"gotcha","affected_versions":"Potentially future Django major versions (e.g., Django 6.x)"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}