Unable to resolve url. Received error- Reverse for 'satchmo_search' with arguments '()' and keyword arguments '{}' not found

StackOverflow https://stackoverflow.com/questions/5127686

Question

I'm installing Satchmo following these instructions: http://forum.webfaction.com/viewtopic.php?pid=10579#p10579

When I want to check my installation, I get the following error:

$ python manage.py satchmo_check
Checking your satchmo configuration.
Using Django version 1.2.5
Using Satchmo version 0.9.2-pre hg-unknown
The following errors were found:
Unable to resolve url. Received error- Reverse for 'satchmo_search' with arguments '()' and keyword arguments '{}' not found.

My urls.py looks like this:

from django.conf.urls.defaults import *
from satchmo_store.urls import urlpatterns

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^myproject/', include('myproject.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/', include(admin.site.urls)),
)

Using the reverse function on the command line, I get:

$ python manage.py shell
Python 2.7.1 (r271:86832, Dec  1 2010, 06:29:57) 
>>> from django.core.urlresolvers import reverse
>>> reverse(satchmo_search)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'satchmo_search' is not defined

I'm new to Satchmo and Django, so any help would be appreciated.

Was it helpful?

Solution

You are overriding the urls you are importing.

Change your urls.py file like so:

from django.conf.urls.defaults import *
from satchmo_store.urls import urlpatterns

urlpatterns += patterns('',

    # Your urls go here

)

or

from django.conf.urls.defaults import *
from satchmo_store.urls import urlpatterns as satchmo_urls

urlpatterns = patterns('',

    # Your urls go here

)

urlpatterns += satchmo_urls
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top