August 2016
Beginner to intermediate
717 pages
15h 24m
English
Sometimes, you might need to allow only specific people to download intellectual property from your website. For example, music, videos, literature, or other artistic works should be accessible only to the paid members. In this recipe, you will learn how to restrict image downloads only to the authenticated users using the contributed Django auth app.
To start, create the quotes app as in the Uploading images recipe.
Execute these steps one by one:
# quotes/views.py # -*- coding: UTF-8 -*- from __future__ import unicode_literals import os from django.shortcuts import get_object_or_404 from django.http import FileResponse ...Read now
Unlock full access