kopia lustrzana https://github.com/wagtail/wagtail
Prevent {{ STATIC_URL }} from being used in templates
rodzic
57fd4656fd
commit
f2b4ac9753
|
@ -0,0 +1,7 @@
|
|||
def do_not_use_static_url(request):
|
||||
def exception():
|
||||
raise Exception("Do not use STATIC_URL in templates. Use the {% static %} templatetag instead.")
|
||||
|
||||
return {
|
||||
'STATIC_URL': lambda: exception(),
|
||||
}
|
|
@ -48,6 +48,7 @@ if django.VERSION >= (1, 8):
|
|||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'django.template.context_processors.request',
|
||||
'wagtail.tests.context_processors.do_not_use_static_url',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -55,6 +56,7 @@ if django.VERSION >= (1, 8):
|
|||
else:
|
||||
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
|
||||
'django.core.context_processors.request',
|
||||
'wagtail.tests.context_processors.do_not_use_static_url',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
|
Ładowanie…
Reference in New Issue