Skip to content
Advertisement

Django not showing group manage options in admin page

Recently, I deployed a Django web app. However, when I’m accessing the admin page, I’m not getting the expected interface to add or remove a user from a certain group:

enter image description here

At the of inspecting the page, I’m receiving the following messages: enter image description here

any idea about how to handle these errros?

Thanks!

Advertisement

Answer

Content Security Policies are usually controlled via middleware like django-csp. All the admin control JavaScript files are included as static files, no external libraries should be loaded, they should be on the same domain.

In order for CSP to allow to load these files, you need to add script-src 'self' (it’s an alias for same-origin). Look inside settings.py for CSP_SCRIPT_SRC keyword and append 'self' (single quotation marks are required).

Note: if CSP headers are added not by Django, but by reverse proxy, like nginx, then you should look and fix configuration settings there.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement