Templatetag pour charger les options du site

This commit is contained in:
Klafyvel 2018-01-20 23:13:30 +01:00
parent 32a7493bb7
commit 5dfa004a4f
2 changed files with 15 additions and 0 deletions

View file

View file

@ -0,0 +1,15 @@
from django import template
from settings.models import SiteSettings
register = template.Library()
@register.tag('load_site_settings')
def load_site_settings(parser, token):
return LoadSiteSettingsNode()
class LoadSiteSettingsNode(template.Node):
def render(self, context):
context['site_settings'] = SiteSettings.get_settings()
return ''