Does Django have HTML helpers?

前端 未结 6 2106
日久生厌
日久生厌 2021-02-07 00:04

Does Django have any template tags to generate common HTML markup? For example, I know that I can get a url using

{% url mapper.views.foo %}

Bu

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 01:01

    I bet if there would be any consent of what is common html, there would be helpers module too, just for completeness (or because others have it). ;)

    Other than that, Django template system is made mostly for HTML people, who already know how to write p, img and a tags and do not need any helpers for that. On the other side there are Python developers, who write code and do not care if the variable they put in context is enclosed by div or by span (perfect example of separation of concerns paradigm). If you need to have these two worlds to be joined, you have do to it by yourself (or look for other's code).

提交回复
热议问题