How to access array elements in a Django template?

前端 未结 4 488
慢半拍i
慢半拍i 2020-11-28 18:27

I am getting an array arr passed to my Django template. I want to access individual elements of the array in the array (e.g. arr[0], arr[1]

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 18:54

    You can access sequence elements with arr.0 arr.1 and so on. See The Django template system chapter of the django book for more information.

提交回复
热议问题