Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get site name in django template?

In the admin interface, I can see how I can specify the name of the site. But I can't find the documentation for how to use it in my templates.

like image 584
Atterratio Avatar asked Oct 01 '22 20:10

Atterratio


1 Answers

I faced a similar problem and found the solution answered in this post: How to display the site's user friendly name in a template in Django?

Basically, in my settings.py, I had to add 'django.core.context_processors.request', to my TEMPLATES -> OPTTIONS -> context_processors. Then you can access the site name in the template with {{ request.site.name }}.

like image 130
Chris Shaw Avatar answered Oct 13 '22 10:10

Chris Shaw