나는 내 블로그를 개발하고 있습니다. 모든 것이 좋았습니다. 나는 그것을 성공적으로 전개하지 못했습니다. 지금은 모든 변경 사항을 취소,하지만 지금은 작동하지라는 이름의 URL (그들은 완벽하게 이전에 일했다) : 오류 :django 1.5 및 python 2.7에서 url이 작동하지 않습니다.
Reverse for ''main_page'' with arguments '()' and keyword arguments '{}' not found
URL :
urlpatterns = patterns('',
url(r'^$', main_page, name='main_page'),
url(r'^blog/', include('blog.blogurls')),
url(r'^comments/', include('django.contrib.comments.urls')),
)
메인 페이지 뷰 :
def main_page(request):
object_list = Article.objects.all()
return render_to_response('blog/main_page.html', {'Latest': object_list}
을 에서 사용되는 명명 된 URL :
<p><a href="{% url 'main_page' %}">home</a></p>
일했다. 템플릿의 변경 사항은 기억이 안납니다. 고맙습니다 – user2647448
템플릿에'{% %부터로드 URL %}'이 있습니까? – alecxe
아니요! 미래의 URL은 무엇입니까? – user2647448