Rendering JSON objects using a Django template after an Ajax call

前端 未结 8 1811
南笙
南笙 2020-12-02 03:59

I\'ve been trying to understand what\'s the optimal way to do Ajax in Django. By reading stuff here and there I gathered that the common process is:

  1. formul

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 04:29

    Unfortunately, Django templates are designed to be executed server side only. There is at least one project to render Django templates using Javascript, but I haven't used it and so I don't know how fast, well supported or up to date it is. Other than this, you have to either use the Django templates on the server or generate dynamic elements on the client without using templates.

提交回复
热议问题