내가 내 템플릿이를 연결하는 방법 :장고 : 장고 템플릿을 사용하는 경우 페이지를 놓고
<div id="comment-{{ post_comment.id }}">
<a title="Comment was useful" href="/useful-comment/{{ blog_post.id }}/{{ post_comment.id }}/">
이 링크, 메소드 useful_comment (blog_post_id, post_comment_id)에 사용자가 클릭이 호출되고에서 반환하면 동일한 템플릿을 다시로드합니다. 그때 #comment 아래로 페이지를 스크롤 할 - {{post_comment.id}}하지만 난 내가 그렇게처럼 내 템플릿을로드하는 경우 그렇게 어떻게 :
arguments = dict(user = request.user, blog_post = blog_post)
t = loader.get_template('blog-post-template.html')
c = RequestContext(request, args)
return HttpResponse(t.render(c))
을이가 있지만에서, Django: How do I position a page when using Django templates 관련이있다 질문은 양식을 사용하고 페이지의 정적 섹션으로 스크롤 만합니다.
[{% url ... %}] (https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#url)을 사용하고있는 이유는 무엇입니까? 주형? –
제안 해 주셔서 감사합니다 :) 나는 장고를 사용하기 시작했습니다. – Felipe
문제가 없습니다! [튜토리얼] (https://docs.djangoproject.com/en/dev/intro/tutorial01/)을 살펴 보는 것을 잊지 마십시오. –