Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change header 'Django administration' text on nginx

I followed this question's answers to change my django admin panel title header.

I tried this:

There is an easy way to set admin site header - assign it to current admin instance in urls.py like this

admin.site.site_header = 'My admin'

But it just works when I'm running the page via Python manage.py runserver

My question is how can I change the admin title header when I'm running the site via gunicorn and nginx

like image 521
Alex Jolig Avatar asked Jan 22 '15 15:01

Alex Jolig


People also ask

How do I change the admin heading in Django?

To change the admin site header text, login page, and the HTML title tag of our bookstore's instead, add the following code in urls.py . The site_header changes the Django administration text which appears on the login page and the admin site. The site_title changes the text added to the <title> of every admin page.

How do I change app label in Django admin?

Rename the folder which is in your project root. Change any references to your app in their dependencies, i.e. the app's views, the urls.py and settings.py files. Edit the database table django_content_type with the following command: UPDATE django_content_type SET app_label='' WHERE app_label=''

Can we change Django admin template?

To do so, you will have to change the project's settings.py . Find the TEMPLATES section and modify accordingly. To override the default template you first need to access the template you want to modify from the django/contrib/admin/templates/admin directory.

How do I change the admin color in Django?

Restart your application server and now you should be able to see a new color scheme added by the package. If you want to customize it further go to your admin and look for “themes” app and do customizations there. Rounded corners for a slight step towards “modern” design.


1 Answers

writing this code at the bottom of urls.py somehow worked:

admin.site.site_header = 'My admin'
like image 160
Alex Jolig Avatar answered Sep 30 '22 07:09

Alex Jolig