Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1053611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:16:46+00:00 2026-05-16T17:16:46+00:00

I am looking over this website but just can’t seem to figure out how

  • 0

I am looking over this website but just can’t seem to figure out how to do this as it’s not working. I need to check if the current site user is logged in (authenticated), and am trying:

request.user.is_authenticated

despite being sure that the user is logged in, it returns just:

>

I’m able to do other requests (from the first section in the url above), such as:

request.user.is_active

which returns a successful response.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:16:47+00:00Added an answer on May 16, 2026 at 5:16 pm

    Update for Django 2.0 and later

    is_authenticated is an attribute

    if request.user.is_authenticated:
        # do something if the user is authenticated
    

    For Django 1.9 and older

    is_authenticated() was a function. Called like:

    if request.user.is_authenticated():
        # do something if the user is authenticated
    

    As Peter Rowell pointed out, what may be tripping you up is that in the default Django template language, you don’t tack on parenthesis to call functions. So you may have seen something like this in template code:

    {% if user.is_authenticated %}
    

    However, in Python code, it is indeed a method in the User class.

    NB: The method was removed in Django 2.0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking over the magento 1.5 schema I cannot seem to figure out how a
I have been looking over the internet for a while about this, but it
All right so I've been looking all over the net and I can't seem
I have been looking over this code for the past hour, I cant see
I have been looking all over for this. I have two seperate prpt files
I've been looking for this extra div for over 5 hours and am at
I'm pretty new to Ruby. I've tried looking over the online documentation, but I
I just recently set up SSL on my website's account creation page. I'm looking
I have this website where I want just only the computers in our office
I'm sure this question has been asked but it's hard to just google specifically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.