Skip to Content
Django 3 Web Development Cookbook - Fourth Edition
book

Django 3 Web Development Cookbook - Fourth Edition

by Aidas Bendoraitis, Jake Kronika
March 2020
Intermediate to advanced
608 pages
17h 17m
English
Packt Publishing
Content preview from Django 3 Web Development Cookbook - Fourth Edition

How it works...

As you will see later in the Using database query expressions recipe in Chapter 10, Bells and Whistles, the detail view of the viral video shows the number of impressions by authenticated and anonymous users. If you access a viral video (such as at http://127.0.0.1:8000/en/videos/1/) and refresh the page a few times with caching enabled, you will notice that the number of impressions changes only once a minute. This is because each response is cached for 60 seconds for every user. We set caching for the view using the @cache_page decorator.

Memcached is a key-value store and it uses the full URL by default to generate the key for each cached page. When two visitors access the same page simultaneously, the first visitor's request ...

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

Django 2 Web Development Cookbook - Third Edition

Django 2 Web Development Cookbook - Third Edition

Jake Kronika, Aidas Bendoraitis

Publisher Resources

ISBN: 9781838987428Supplemental Content