Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

198
Vistas
Django's FILE_UPLOAD_PERMISSIONS not working for directories

I'm trying to use Django's FILE_UPLOAD_PERMISSIONS to set permissions when a user uploads a file. The file itself is created with the correct permissions (775), but any directories created seem to be stuck with the default (755).

Example: If a file (foo.jpg) is uploaded for a user (id = 123), it should save to media/123/foo.jpg, creating the 123 directory if it does not already exist. foo.jpg has 775 but 123 has 755.

How can I get directories saving with the correct permissions? I am using Apache with mod_wsgi in a httpd Docker container if it is relevant.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Django has a seperate setting for file directory permisions. It is FILE_UPLOAD_DIRECTORY_PERMISSIONS. You should set this as 0o775 in your settings.py file.

FILE_UPLOAD_DIRECTORY_PERMISSIONS documentation

File storage API documentation

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda