강의로 돌아가기
김수정

TemplateSyntaxError at /areas/미국/

TemplateSyntaxError at /areas/미국/ 에러가 납니다.
아래는 페이지의 에러 코드 입니다...
도와주세요...

Could not parse the remainder: '% for candidate in candidates %' from '% for candidate in candidates %'
Request Method: GET
Request URL:    http://127.0.0.1:8000/areas/%EB%AF%B8%EA%B5%AD/
Django Version: 1.11.1
Exception Type: TemplateSyntaxError
Exception Value:    
Could not parse the remainder: '% for candidate in candidates %' from '% for candidate in candidates %'
Exception Location: /home/soojung/.local/lib/python2.7/site-packages/django/template/base.py in parse, line 515
Python Executable:  /usr/bin/python
Python Version: 2.7.12
Python Path:    
['/home/soojung/dev/newsite',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/home/soojung/.local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']
Error during template rendering

In template /home/soojung/dev/newsite/elections/templates/elections/area.html, error at line 27
Could not parse the remainder: '% for candidate in candidates %' from '% for candidate in candidates %'
17      <table class="table table-striped">
18          <thead>
19          <tr>
20              <td><B>이름</B></td>
21              <td><B>소개</B></td>
22              <td><B>기호</B></td>
23              <td><B>지지하기</B></td>
24          </tr>
25          </thead>
26          <tbody>
27          {{% for candidate in candidates %}}
28          <tr>
29              <td> {{candidate.name}}</td>
30              <td> {{candidate.introduction}} </td>
31              <td> 기호 {{candidate.party_number}} </td>
32              <td>
33                  <form action = "#" method="post">
34                      <button name="choice" value="#">선택</button>
35                  </form>
36              </td>
37          </tr>
1 개의 답변
김수정

해결했습니다.

-> {{% for candidate in candidates %}} -> 가 아니라 { % 내용 %} 괄호가 1개만 있어야하는데 2개 있어서 오류났습니다.

답변 쓰기
이 입력폼은 마크다운 문법을 지원합니다. 마크다운 가이드 를 참고하세요.