L
L
Lopus2019-12-11 12:06:57
Django
Lopus, 2019-12-11 12:06:57

How to set up permission checking in django for media?

Files uploaded through the admin panel are stored in / media /
How would I block access to this directory for certain files?
I suppose that you can somehow check it in scripts (by removing the direct return of files from / media / from the apache / nginx settings), but it’s not clear where.
Is it possible to do something through Middleware or do I need to write my own view for media/* ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question