How to add logo to django header

2,071 views
Skip to first unread message

Gauri Shirsath

unread,
Jul 28, 2016, 4:06:17 AM7/28/16
to Django users
Hi,

I want to show company logo instead of 'Django Administrator' heading.
Can someone please guide me.

Regards,
Gauri

Constantine Covtushenko

unread,
Jul 28, 2016, 5:24:14 AM7/28/16
to django...@googlegroups.com
Hi Gauri,

One of approach is would be to override admin base template used as a parent for all admin pages.
Please see that documentation link about how to do that.

Regards,

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/991a1cf4-8a32-4941-ae43-e7a3f46916af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Siddharth Ghumre

unread,
Jul 28, 2016, 5:30:50 AM7/28/16
to django...@googlegroups.com
Hi,


The file you are looking for is base_site.html which you need to override to change the default 'Django Administrator' heading to your company logo.

Hope this helps.

-Sid

--

Volodymyr Kirichinets

unread,
Jul 28, 2016, 8:33:34 AM7/28/16
to Django users
Hi,
open     /your/path/to/python2.7/site-packages/django/contrib/admin/templates/admin/base.html  file
add  to top of file :    <link rel="icon" type="image/png" href="{% static 'Path/To/static/images/yourlogo.png' %}" />
And You get a logo!

Volodymyr Kirichinets

unread,
Jul 28, 2016, 8:47:14 AM7/28/16
to Django users
This if You want to change icon.

Volodymyr Kirichinets

unread,
Jul 28, 2016, 9:04:39 AM7/28/16
to Django users
If You want to change background of the header, Try this
open  :   /you/path/to/python2.7/site-packages/django/contrib/admin/static/admin/css/base.css
add
h1 {
    .....................
    ........................
    background:url("path/to/you/static/images/youlogo.png");
}

ludovic coues

unread,
Jul 28, 2016, 9:33:22 AM7/28/16
to django...@googlegroups.com
You are suggesting to alter the django library directly. This as two
immediate bad effect.

First, it make upgrading to newer and more secure version of django
harder as the change will be overwritten by the upgrade.

Second, if you want to keep your track of your change, using git for
exemple, you will need to add the whole django directory. This take a
lot of space.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e23f6d97-b751-4e94-afc8-249c9741ae83%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

Yogesh Mishra

unread,
Aug 14, 2017, 12:49:10 PM8/14/17
to Django users
Thanx

Volodymyr Kirichinets

unread,
Aug 15, 2017, 10:54:00 AM8/15/17
to django...@googlegroups.com
Hi,
You can do this with base_site.html just change all of You need.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/3Stx_IAZK6k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages