3
Zugriffsanforderung in benutzerdefinierten Django-Vorlagen-Tags
Mein Code in myapp_extras.py: from django import template register = template.Library() @register.inclusion_tag('new/userinfo.html') def address(): address = request.session['address'] return {'address':address} in 'settings.py': TEMPLATE_CONTEXT_PROCESSORS =( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", 'django.core.context_processors.request' ) aber ich habe einen Fehler bekommen: TemplateSyntaxError at /items/ Caught an exception while rendering: global name 'request' is not defined Original …