{"repo":"cobusc/django-protected-media","free":true,"listed":false,"github":"https://github.com/cobusc/django-protected-media","clone":"git clone https://github.com/cobusc/django-protected-media.git","description":"Separate handling of protected media in Django, with X-Sendfile support","language":"Python","stars":70,"topics":["django","python","nginx"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"Django Protected Media ====================== Django Protected Media is a Django app that manages media that are considered sensitive in a protected fashion. Not only does the media get stored in a separate filesystem location, but authorisation is also required to access it. The application allows for setups where Django performs the authorisation, but hands off the serving of the file to a web server, like Nginx. Quick start ----------- 1. Install the package with pip like this: 2. Add \"protected media\" to your INSTALLED APPS setting like this: 3. Include the URLconf in your project urls.py like this:: 4. Add the following settings to settings.py if the defaults need to be tweaked: 5. Use the new field classes in your models: Overview -------- Django manages media based on the following definitions: File- and image fields are typically defined as: In a typical production environment one would let nginx (or some other server) serve the media: This works well when the media should be publically accessible. However, if the media should be protected, we need a way for Django to check whether the request for the media should only be allowed for logged in (or more stringent criteria) users. The protected media application -------------------------------- The protected media application consists of new settings.py attributes, a customized FileSystemStorage class, a custom handler for the protected media URL and additional web server configuration if serving via nginx or something ","default_branch":null,"files":null,"tree":[],"storefront":"/r/cobusc","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cobusc/django-protected-media/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}