2016-03-07 7 views

Antwort

9

Ab django 1.9 können Sie die folgenden Funktionen Ihre Vorlageneinstellungen hinzufügen:

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', 
      ], 
     }, 
    }, 
] 
:

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

Zum Beispiel kann die ganze Vorlage Einstellung könnte wie folgt aussehen

Verwandte Themen