Als «django-custom-tags» getaggte Fragen

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 …
Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.