Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!