Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - serving and managing permissions for static content

I have certain documents that I want to limit access to through Django to authorized users with permissions only.

If I'm going to use Django as a proxy to serve static files in a view, what are the implications? I'm used to serving static files in Apache and configuring that my media is served without any handlers, but what happens if someone starts downloading 500mb through my Django proxy? Will my Django thread be locked for that user until he recieves the 500mb response?

like image 465
Filip Dupanović Avatar asked Apr 25 '10 09:04

Filip Dupanović


People also ask

What does Collectstatic do in Django?

Django also provides a mechanism for collecting static files into one place so that they can be served easily. Using the collectstatic command, Django looks for all static files in your apps and collects them wherever you told it to, i.e. the STATIC_ROOT .

What is static root in Django?

"STATIC_ROOT" sets the absolute path to the folder where static files used for the apps and admin in a django project are stored and this command below creates the folder and collects static files from the apps and admin in a django project into the folder (*Setting "STATIC_ROOT" never ever influence to static file URL ...


1 Answers

See the answers to this question to learn how to tell the web server to handle serving the file.

like image 106
Ignacio Vazquez-Abrams Avatar answered Oct 18 '22 22:10

Ignacio Vazquez-Abrams