2011-02-26 23 views
0

我安裝的Satchmo以下說明:http://forum.webfaction.com/viewtopic.php?pid=10579#p10579無法解析網址。接收無誤反轉爲「{}」未找到「satchmo_search」與參數「()」和關鍵字參數

當我想檢查我安裝,我得到的以下錯誤:

$ 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. 

urls.py看起來是這樣的:

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)), 
) 

使用命令行reverse功能,我得到:

$ 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 

我是新來的Satchmo和Django,所以任何幫助,將不勝感激。

回答

3

您正在重寫正在導入的網址。

更改您的urls.py文件,像這樣:

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

urlpatterns += patterns('', 

    # Your urls go here 

) 

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

urlpatterns = patterns('', 

    # Your urls go here 

) 

urlpatterns += satchmo_urls 
相關問題