How to change 'Django Administration' name

2019-07-25 11:17发布

问题:

I am trying to change the name of django administration to custom name how do i do that.Is there any way completely customize the admin page give it more professional look

回答1:

There are several ways to customize the Django admin.

First of all, you can always override any template (see docs : https://docs.djangoproject.com/en/1.6/intro/tutorial02/#customize-the-admin-look-and-feel it is actually using this very case as example)

Starting with Django 1.7, it will be accessible via settings : https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-attributes

Finally, you could use a admin skin app such as the wonderful Grappelli wich already provides a similar setting : http://django-grappelli.readthedocs.org/en/latest/index.html

Hope this helps,

Regards,



回答2:

Copy the admin templates to your project template folders (if you don't know how, just create an admin subdirectory in your project/templates folder). The django branding is located in: base_site.html file. You can find the source of it either in your django installed package or by checking the source code in github: https://github.com/django/django/blob/stable/1.6.x/django/contrib/admin/templates/admin/base_site.html

Additionally with this method you can also completely override the default admin implementation, if you are not familiar or you don't want to spend so much time in it, you can also use a ready to use package such as grapelli: http://grappelliproject.com/ or django suit: http://djangosuit.com/

Note that branding will change in the next django release, the user will be able to define those in the settings file: https://docs.djangoproject.com/en/dev/releases/1.7/#minor-features