我收到“反向''主页''参数'()'和关键字参数'{}'未找到“在Django的错误。任何人都可以帮我解决这个问题。带有参数'()'和关键字参数'{}'的''家''反向
我base.html文件是
<html>
<head>
<title>Steel Rumors</title>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/main.css" />
</head>
<body>
<h1>Steel Rumors</h1>
{% block content %}
{% endblock %}
<footer>
<p>
<a href="{% url 'home' %}">Home</a>
</p>
</footer>
</body>
</html>
我urls.py是
from django.conf.urls import patterns, include, url
from links.views import LinkListView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', LinkListView.as_view(), name='home'),
url(r"^login/$", "django.contrib.auth.views.login",
{"template_name": "login.html"}, name="login"),
url(r"^logout/$", "django.contrib.auth.views.logout_then_login",
name="logout"),
)
view.py是
from django.views.generic import ListView
from .models import Link, Vote
class LinkListView(ListView):
model = Link
queryset = Link.with_votes.all()
paginate_by = 3
Django的1.4版本 在此先感谢
您正在使用的Django的版本? –
设置'DEBUG = True'它会给你更详细的信息。 – Rohan