Pattern – services

Problem: Applications need a machine interface to a certain capability or information in your website. Scraping data from rendered HTML pages can be cumbersome. Unlike full-fledged APIs (which are covered in Chapter 8, Working Asynchronously) this refers to the need for a single endpoint for a specialized purpose or one-time use.

Solution: Create lightweight services that return data in machine-friendly formats, such as JSON or XML.

Get Django Design Patterns and Best Practices - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.