无法解析网址。收到错误 - 反向“satchmo_search”带参数 '()'和关键字参数 '{}'未找到
我按照以下说明安装 Satchmo: http://forum.webfaction.com/ viewtopic.php?pid=10579#p10579
当我想检查我的安装时,出现以下错误:
$ 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 的新手,所以任何帮助将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在覆盖您正在导入的网址。
像这样更改你的 urls.py 文件:
或者
You are overriding the urls you are importing.
Change your urls.py file like so:
or