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 8843849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:20:17+00:00 2026-06-14T11:20:17+00:00

I have template like this : <html> <body> You are logged as John Kowalski

  • 0

I have template like this :

<html>
<body>
You are logged as John Kowalski
</body>
</html>

I would like show first_name and last_name of user but this doesn’t work:

<html>
<body>
You are logged as {{ request.user.first_name }} {{ request.user.last_name }}
</body>
</html>

How can I get user object in template?

  • 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-06-14T11:20:19+00:00Added an answer on June 14, 2026 at 11:20 am

    You need to do a few things:

    First, add the following to your settings:

    TEMPLATE_CONTEXT_PROCESSORS = (
        'django.core.context_processors.request', 
    )
    

    (You can add other context processors, but this is the relevant one.)

    Second, in your views:

    Import this:

    from django.template import RequestContext
    

    And in your views, return your templates like this:

    return render_to_response('something.html', context_instance=RequestContext(request))
    

    You can now access the request object in your template.

    Learn more here: https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext

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

Sidebar

Related Questions

Absolute beginner question: I have a template file index.html that looks like this: ...
I have a xml template like this <User> <UserId></UserId> <UserName></UserName> <Roles> <Role></Role> <Roles></Role> </Roles>
I have a product template that looks like this: The html for it is:
I have template that looks like this: 100 template<size_t A0, size_t A1, size_t A2,
Imagine I have a template function like this: template<typename Iterator> void myfunc(Iterator a, typename
I have code that looks like this: template<class T> class list { public: class
I have a recursive data type like this: template<typename T> struct SomeType { std::map<T,
I have a templated container class that looks something like this: template <class ItemType>
Suppose I have a function which looks like this: template <class In, class In2>
I have a Visual Studio 2008 C++ application that does something like this: template<

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.