I’ve set up Django with Apache2 + mod_wsgi. The static Files are served by Nginx. Apache is running on Port 81 and nginx on Port 80.
my settings are like this:
MEDIA_ROOT = ‘http://localhost/media/’
ADMIN_MEDIA_PREFIX = ‘http://localhost/media/’
Everything looks fine. At https://localhost:81/admin I can see the Django Admin Site with its static files.
I created a new app with this model:
class Song(models.Model):
song = models.FileField(upload_to=’songs’)
When I try to upload a file over the admin site i get following error.
OSError at /admin/player/song/add/
[Errno 13] Permission denied: ‘/http:’
Request Method: POST
Request URL: http://localhost:81/admin/player/song/add/
Django Version: 1.3.1
Exception Type: OSError
Exception Value:
How do I allow apache to apply changes to nginx
You’ve set your
MEDIA_ROOTto a url. I think it should be set to a physical location, I think the same goes for theADMIN_MEDIA_PREFIX. I would try changeand
You’ll also have to set permissions to the media folder. I think you need to give
www-datawrite permissions.