March 2020
Intermediate to advanced
608 pages
17h 17m
English
You might have noticed the logger.debug() statement in the view. If you run the server in DEBUG mode and access a video in the browser (for example, http://127.0.0.1:8000/en/viral-videos/2b14ffd3-d1f1-4699-a07b-1328421d8312/, in local development), you will see an SQL query like the following printed in the logs (tmp/debug.log):
SELECT "viral_videos_viralvideo"."created", "viral_videos_viralvideo"."modified", "viral_videos_viralvideo"."uuid", "viral_videos_viralvideo"."title", "viral_videos_viralvideo"."embed_code", "viral_videos_viralvideo"."anonymous_views", "viral_videos_viralvideo"."authenticated_views", ("viral_videos_viralvideo"."authenticated_views" + "viral_videos_viralvideo"."anonymous_views") AS "total_views",