print the value of a variable in Python/Django?

后端 未结 2 1399
慢半拍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:11

    
    {{ this_is_my_variable_that_is_passed_to_my_view }}
    
    

    the {{ allow variable access to the item which will call the items __unicode__ function if it exists otherwise it will call its __str__ function

提交回复
热议问题