50번째 줄: |
50번째 줄: |
| | | | | |
| |} | | |} |
| + | |
| + | == 뷰 수정 == |
| + | 기본적인 뷰의 형태는 다음과 같다.<syntaxhighlight lang="python"> |
| + | def likes(request): |
| + | if request.is_ajax(): # ajax인지 여부 판별 |
| + | .... |
| + | context = {'like_count' : post.like.count(), "message":message} # 보낼 데이터 담기 |
| + | return HttpResponse(json.dumps(context), content_type='application/json') |
| + | </syntaxhighlight> |
| [[분류:장고 기능구현(중급)]] | | [[분류:장고 기능구현(중급)]] |