I want to share with you my framework for Django SPA creation. It is a client side framework that supports Django server side rendered views. So, basically, it changes nothing about how Django works, just facilitates the organization of your ajax calls to retrieve views from the server and update partial pages client side. If you were to build your own home grown SPA against Django you would end up writing the same kind of code using async calls. The difference is that this framework already has all the plumbing, edge cases, error handling, and user interaction control ready for you. It can be found as open source on Github and is called WebRocketX. It even supports Django’s native CSRF token architecture by allowing the customization of the CSRF token name, which in Django is “csrfmiddlewaretoken”. There is an example implementation of WebRocketX implemented with Django in the templates folder along with the source code. Let me know if you have any questions or difficulties. Django rocks!
1 Like