Okay, I probably couldn’t explain the issue in the title very well but I am building a Django app which will have various contributors. These contributors will not have superuser privileges but only some read/write privileges.
Right now, I have a custom AdminSite
which can be accessed by the Contributors. Here’s the code:
admin.py
class ContributorAdmin(AdminSite):
def has_permission(self, request):
return request.user.is_active
urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path('contributor/', contrib_admin_site.urls),
path('login/', loginview, name='login'),
path('logout/', logoutview, name='logout'),
#other paths for the app
]
This is working as intended and gives the contributors access to the admin interface with limited privileges. However, what I would like to do is create a custom Admin UI (not the built-in Django one) which will be used by the Contributors.
As an example, I would like to have a contributor.html
in my templates which provides Admin like interface to the contributors but the styling
etc. is all customized.
Also, I would like to have my login
and logout
views to redirect to this custom page only. Right now, the login
page redirects to ContributorAdmin
so my custom logout
view becomes useless. Is it possible to do this? Thanks in advance!