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

383
Views
Django: How to automatically set correct media folder permissions?

I am running a Django application using Apache webserver.

The media directory is located in /var/www/app/media/. Owner of that directory is www-data:www-data, so that Apache can read / write to it.

The problem now is that when I run ./manage.py migrate and a new sub-folder in the media directory is created when I add a new FileField to a model, the owner of that directory is the user running that migrate command and I have to fix the owner of that new folder, otherwise Apache can't write to it and I am getting a Permission denied error.

How can I set permissions to the folder /var/www/media/that user www-data can write to any new subfolder, even when that subfolder is created by another user ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

you can do sudo chmod -R 775 /var/www/media/

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!