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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:22:47+00:00 2026-06-17T04:22:47+00:00

Its my first time coming across such an error and i have looked around

  • 0

Its my first time coming across such an error and i have looked around but failed to find the error happening in the same situation.The redirection is supposed to happen to happen when a user submits a form.

In my views i use a reverse() function to return a url and redirect to it.
Here are is the views:

def get_category(request):
    categories = Category.objects.all().prefetch_related('item')
    form = ItemAddToCartForm(request=request, label_suffix=':')
    # need to evaluate the HTTP method
    if request.method == 'POST':
        # add to order..create the bound form
        postdata = request.POST.copy()
        form = ItemAddToCartForm(request,postdata)
        # check validation of posted data
        if form.is_valid():
            # add to order and redirect to order page
            order.add_to_order(request)
            # if test cookie worked, get rid of it
            if request.session.test_cookie_worked():
                request.session.delete_test_cookie()
            url =urlresolvers.reverse('show_order')
            # redirect to order page
            return HttpResponseRedirect(url)
    else:
        # it's a GET, create the unbound from. Note request as a Kwarg
        form = ItemAddToCartForm(request=request,label_suffix=':')
    # assign the hidden input the item slug
    # set the test cookie on our first GET request
    request.session.set_test_cookie()
    context={
        'categories':categories,
        'form':form,
#       'menu':menu,

    }
    return render_to_response('category.html',context,context_instance=RequestContext(request)) 

Here is the view of the url it directs to:

def show_order(request):
    if request.method == 'POST':
        if postdata['submit'] == 'Remove':
            order.remove_from_order(request)
        if postdata['submit'] == 'Update':
            order.update_order(request)
    order_items = order.get_order_items(request)
    page_title  = 'F4L order' 
    order_subtotal = order.order_subtotal(request)
    return render_to_response('public/order.html',context_instance=RequestContext(request))

the urls for the above view:

from django.conf.urls.defaults import *

urlpatterns = patterns(
    'live.views',
    url(r'^$', view="show_order",name="order_index"),
)

urls for both views:

url(r'^orders/', include('live.urls')),
url(r'^menu/$','live.views.get_category'),

here is the form html:

<form method="post" action=".">
  <a href="{% url order_index %}">
  {% csrf_token %}
   {{ form.as_p }}
  <br />
   <input type="submit" value="Add To Order" name="submit">
  </a>

Traceback:
File "/home/mats-invasion/projects/f4l/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/mats-invasion/projects/f4l/f4l/live/views.py" in get_category
  39.           url =urlresolvers.reverse('show_order')
File "/home/mats-invasion/projects/f4l/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
  476.     return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "/home/mats-invasion/projects/f4l/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
  396.                 "arguments '%s' not found." % (lookup_view_s, args, kwargs))

Exception Type: NoReverseMatch at /menu/
Exception Value: Reverse for 'show_order' with arguments '()' and keyword arguments '{}' not found.

Thank you.

  • 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-17T04:22:49+00:00Added an answer on June 17, 2026 at 4:22 am

    The value passed to reverse should be the name of the url not the view.

    url =urlresolvers.reverse('order_index')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First time user of stackoverflow, but I have followed its development over on Coding
I have an app, in that app if its the first time the user
It's the first time I have done anything like this but wondered what the
Its my first time to use web service in iOS. REST was my first
It's my first time to develop an RCP application with Eclipse 3.8. My question
It's my first time dealing with cookies in JavaScript and the below script works
It's my first time trying to make anything really interesting in C# and I
it s the first time i try this page. I ve just installed imagemagick
First of all it's my first time in Mongo... Concept: A user is able
I'm familiarizing myself with Ruby and it's the first time I see synonyms for

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.