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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:28:49+00:00 2026-05-11T18:28:49+00:00

I have a urlpatterns like this: urlpatterns = patterns(”, … (r’^(?P<object_id>\d+)/$’, ‘django.views.generic.list_detail.object_detail’, info_dict, ‘poll_detail’),

  • 0

I have a urlpatterns like this:

urlpatterns = patterns('',
...
    (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict, 'poll_detail'),
...

My html page template contains this:

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

My view code contains:

    return HttpResponseRedirect(reverse('poll_detail',args=(p.id,)))

My question is, where in the reverse() call do I place my ‘error_message’ variable value?

Apologies if this is a stupid question but I have attempted to search the documentation.

  • 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-11T18:28:49+00:00Added an answer on May 11, 2026 at 6:28 pm

    reverse() converts a view name to a URL. It does not call the view. Also, it can only set arguments in the URL; it cannot set template tags.

    What you can do is make error_message an argument to the poll_detail view. This way, you can pass its value to the view using reverse().

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

Sidebar

Related Questions

In Django, I have images stored in site_media like this : /site_media/somepath/image.jpg The urls.py
If I have following url conf: urlpatterns = patterns('', url(r'^projects-json$', 'projects.views.list'), ) And I
I have the following urlconf: urlpatterns = patterns('page.manager.views', url(r'^$', 'pages', name='page_manager-pages'), url(r'^add/$', 'add_page', name='page_manager-add_page'),
I have an urls.py: from django.contrib.auth.views import (password_reset, password_reset_done, password_change, password_change_done) [...] urlpatterns +=
I'm making a weblog site in Django. I have a Blog model like this:
I have two similar codes. The first one works as expected. urlpatterns = patterns('',
In my project I have one app which have its own urls.py like this
I've seen somewhere a urls.py construct like this: from project.f import SomeClass urlpatterns =
I'd like to love Django, but this business of static and media files in
My urls.py of the project looks like this from django.conf import settings from django.conf.urls.defaults

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.