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

505
Views
I have Deployed My Django App in apache server . All the static files are getting served properly but its not accepting media files from Form Input

While Submitting a form having media input its showing

[Errno 13] Permission denied: '/home/ubuntu/django/media/pictures'

I have searched in google but no one told giving permissions for media files , they ever all telling about static files only . Can any one please tell me which permission i have to give to it with chmod no.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You're having permissions issues. To fix it, you need to allow the Apache process access to the folder and it's content.

This can be done through the following steps

  1. Change the permissions to read and write

    chmod 664 /home/ubuntu/django/media/pictures -R
    
  2. Give the group Apache runs under (www-data group) group ownership of the folder and its content

    sudo chown -R :www-data ~/home/ubuntu/django/media/pictures
    
  3. Restart the Apache service

    sudo service apache2 restart
    

If you want to ensure Django behaves as it should, you can also add the following to your settings.py

FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
FILE_UPLOAD_PERMISSIONS = 0o644
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!