python - Load static files for all templates in django -


is there way in django not need {% load static %} @ top of every template?

this question indicates can factor out common load tags settings, doesn't give particulars need in case.

as of django 1.9, can add following template settings:

'builtins': ['django.contrib.staticfiles.templatetags.staticfiles'] 

for example, whole template setting might this:

templates = [     {         'backend': 'django.template.backends.django.djangotemplates',         'dirs': [],         'app_dirs': true,         'options': {             'context_processors': [                 'django.template.context_processors.debug',                 'django.template.context_processors.request',                 'django.contrib.auth.context_processors.auth',                 'django.contrib.messages.context_processors.messages',             ],             'builtins': [                 'django.contrib.staticfiles.templatetags.staticfiles',             ],         },     }, ] 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -