O'Reilly logo

Lightweight Django by Mark Lavin, Julia Elman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Single-Page Web Application

Designing enriching experiences for the Web is something that we, as developers, consistently strive for. In recent years we have grown accustomed to combining different languages and frameworks, which usually requires better communication between the client-side and backend infrastructures.

With the recent shift in focus to client-side-heavy development, we’re likely to pay even greater attention to the organization and structure of how we lay out the architecture of our projects. In this chapter, we’ll create a simple single-page web application and step through how the Django framework fits into this new shift in development.

What Are Single-Page Web Applications?

Single-page web applications—SPAs—are a big part of this shift to client-side development. There are a few misconceptions as to what they are and how they should be used. Some developers believe that this category of applications includes only those that just need a single page, such as a to-do application. It’s a reasonable assumption, but that is not entirely what the term “single page” means with these types of applications.

The “single page” part of an SPA refers to the fact that the server sends the client all of the presentation logic needed to a single page. From this starting point, the browser manipulates the data to create pages asynchronously and on an “as needed” basis. After this initial page load, the server interacts with the client over the API, sending only data on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required