Skip to Content
Building SPAs with Django and HTML Over the Wire
book

Building SPAs with Django and HTML Over the Wire

by Andros Fenollosa
August 2022
Intermediate to advanced
264 pages
4h 27m
English
Packt Publishing
Content preview from Building SPAs with Django and HTML Over the Wire

Chapter 8: Simplifying the Frontend

Throughout the chapters (e.g., doing the chat project or the blog), we wrote sloppy JavaScript code. We were forced to repeat tasks every time the backend sent new HTML, cleaning up orphaned events and reassigning new ones to the newly created DOM. Our ambitions with the frontend have been quite modest. We’ve limited ourselves to surviving by focusing all our energies on the Django code. If we had had a tool to handle events via HTML rendered by the server, the JavaScript code would have been less verbose and much easier to work with. It’s time to refactor the frontend, but we need help to do that.

Stimulus is ideal for the job. We are talking about a framework whose objective is to constantly monitor changes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Django 2 and Channels 2: Building Projects and Applications with Real-Time Capabilities

Practical Django 2 and Channels 2: Building Projects and Applications with Real-Time Capabilities

Federico Marani
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 9781803240190Supplemental Content