1
我很久沒有使用Django了。我忘記了如何解決很多常見的問題。 該網站在Dj 1.3上。有一天剛開始返回一個錯誤:與意外的論點沒有反向匹配
Exception Value:
Reverse for 'page' with arguments '(u'yoga-class',)' and keyword arguments '{}' not found.
我沒有通過任何參數。傳遞的參數是沒有域名的域名,完整域名是yoga-class.in.ua。網站工作了2年。
查看:
class Index(ListView):
"""Front page, different from the list of posts just extra header.
On this page displayes category with checked "frontpage" checkbx."""
template_name = 'shivaapp/index.djhtml'
context_object_name = 'post_list'
def get_queryset(self):
news = PostPages.objects.filter(parent_category__frontpage=True)
news = news.order_by('move_to_top').reverse()
return news
def get_context_data(self, **kwargs):
"""Extra data for header shifters."""
context = super(Index, self).get_context_data(**kwargs)
context['slideshow'] = ShivaImage.objects.filter(
slide_show=True).order_by('ordering')
context['dictums'] = Dictum.objects.order_by('ordering')
return context
網址:
urlpatterns = patterns('',
url(r'^$', Index.as_view(paginate_by=5)),
(r'^feed/$', RSSFeed()),
(r'^search', Search.as_view()),
(r'^description/$', markdown_desc),
(r'^redirect/(?P<url>\w+)/$', redirect_view),
url(r'^cat/(?P<hash>[\w+\s]*)/$',
CategorizedPostsView.as_view(paginate_by=5)),
url(r'^page/(?P<slug>\w+)/$', PageOrSinglePost.as_view(), name='page'),
url(r'^post/(?P<slug>\w+)/$', PageOrSinglePost.as_view(), name='post'),
)
的httpd.conf:
Alias /robots.txt /var/www/path/to/robots.txt
Alias /favicon.ico /var/www/path/to/favicon.ico
AliasMatch ^/([^/]*\.css) /var/www/i159/path/to/site_media/static/css/$1
Alias /media/ /var/www/i159/path/to/media/
Alias /static/ /var/www/i159/path/to/site_media/static/
<Directory /var/www/i159/path/to/static>
Order deny,allow
Allow from all
</Directory>
<Directory /var/www/i159/path/to/media>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias//var/www/i159/path/to/deploy/wsgi.py
WSGIDaemonProcess local-shivablog.com python- path=/var/www/i159/data/shivablog/:/usr/bin/python2.7/lib/python2.7/site-packages
WSGIPythonHome /usr/bin/python2.7/
<Directory /var/www/i159/path/to>
<Files wsgi.py>
Order allow,deny
Allow from all
</Files>
</Directory>
我應該怎麼找?
感謝您的幫助!很清楚,但不知道這個東西在2年內工作! – I159