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

  • Home
  • SEARCH
  • 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 641047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:01:14+00:00 2026-05-13T21:01:14+00:00

I am trying to create a custom context processor which will render a list

  • 0

I am trying to create a custom context processor which will render a list of menu items for a logged in user. I have done the following:


Within my settings.py I have

TEMPLATE_CONTEXT_PROCESSOR = (
    'django.contrib.auth.context_processors.auth',
    'mysite.accounts.context_processors.user_menu',
)

Under the accounts submodule I have context_processors.py with the following, for now:

def user_menu(request):
    return {'user_menu':'Hello World'}

On my template page I have the following:

{% if user.is_authenticated %}
Menu
{{user_menu}}
{% endif %}

The invoking view is as follows:

def profile(request):
    return render_to_response('accounts/profile.html',context_instance=RequestContext(request))

However I am unable to get the {{user_menu}} to render anything on the page, I know the user is authenticated as other sections of the template with similar checks render correctly. Am I missing something here. Please help
Thank you

Edit: Thanks Ben, Daniel, I have fixed the (S) in TEMPLATE_CONTEXT_PROCESSOR, however Django now has trouble resolving the module and I get the following message

Error importing request processor module django.contrib.auth.context_processors: "No module named context_processors"

UPDATE: I fixed it by changing the path to django.core.context_processors.auth Seems like the modules have been moved around

  • 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-13T21:01:14+00:00Added an answer on May 13, 2026 at 9:01 pm

    The setting name should be TEMPLATE_CONTEXT_PROCESSORS, with an S.

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

Sidebar

Related Questions

I'm trying to create a custom control - a button - which will have
I have an Outlook 2010 addin, and I'm trying to create a custom context
I'm tasked with trying creating a site which will create custom HTML templates. The
I'm trying to create a vector of custom items that I have created but
I am trying to create a custom User library in CodeIgniter. Inside this library
I'm trying to create a custom component to extend PrimeFaces. I have a simple
I am trying to create a custom control which does nothing except decorate the
I am trying to create a list view which as TextView that can display
I am trying to create a custom event which listens and responses to the
So I'm interested in creating a custom context menu for each of my list

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.