파이썬 django ==1 파이썬 django if tag 파이썬 django if 문 if 문은 변수를 평가하고 값이 참이면 코드 블록을 실행한다. templates.html {% if greeting == 1 %} Hello {% endif %} In views.py you can see what the greeting variable looks like. views.py from django.http import HttpResponse from django.template import loader def testing(request): template = loader.get_template('template.html') context = { 'greeting': 1, } return HttpResponse(template.render(context, req.. 2024. 3. 4. 이전 1 다음