Open utterances-bot opened 10 months ago
Just a tip for Django from 4.2 on - you need to use html[data-theme="light"], :root
instead of just :root
for the CSS selector. You also need to use --header-bg
as the CSS variable for the banner background color.
Thanks! This is a great tip! I learned a lot getting this working, and it will help make site mgmt safer.
Might also be helpful to highlight that one needs to add a custom context processor to inject the ENVIRONMENT setting into the admin templates (and all other templates). e.g. https://stackoverflow.com/questions/49761954/how-to-use-a-custom-context-processor and https://docs.djangoproject.com/en/4.2/ref/templates/api/#writing-your-own-context-processors
@wshayes Thanks, those are excellent points!
Customize the Django admin to differentiate environments - Matthias Kestenholz
https://406.ch/writing/customize-the-django-admin-to-differentiate-environments/?utm_campaign=Django%2BNewsletter&utm_medium=email&utm_source=Django_Newsletter_204