print the value of a variable in Python/Django?

后端 未结 2 1383
慢半拍i
慢半拍i 2021-01-07 19:03

In PHP I\'m used to being able to do print $var or print_r($var).

I can print variables in my views in python but they end up in my cmd win

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 19:31

    {{ your_variable }} will print the value.

    https://docs.djangoproject.com/en/dev/ref/templates/api/#basics

提交回复
热议问题