Ah, never mind, misread the question.
Are you sure you're using a RequestContext?
On Fri, Nov 25, 2016 at 3:23 PM, James Bennett <ubernostrum@gmail.com> wrote:
The auth context processor provides it, but not as a variable named 'user'; instead it's attached to the 'request' variable, so what you want is '{% if request.user.is_authenticated }}'.On Fri, Nov 25, 2016 at 3:02 PM, Drew Ferguson <blacktav@gmail.com> wrote:Hi--Using Django 1.10In my templates there is no user object to provide user.is_authenticatedIs there something I have to do to turn this on?My settings has thisTEMPLATES = [{'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', ],},},]MIDDLEWARE = ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware', ]ThanksDrew
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0392acda-3e6d .-41d6-9a6f-1b2a07f9146f%40goog legroups.com
For more options, visit https://groups.google.com/d/optout .
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL13Cg9FZ6H6J%2B-5iByR-pVwbLsWXB%2BnA0rj24qK8%3Dq8AyHL-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment