0
votes

I'm trying to upload an image through the django interface but I keep encountering this error

 [Errno 13] Permission denied: '/hello'

/usr/lib/python2.6/os.py in makedirs

            makedirs(head, mode)

        except OSError, e:

            # be happy if someone already created the path

            if e.errno != errno.EEXIST:

                raise

        if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists

            return

    mkdir(name, mode)

...

def removedirs(name):

    """removedirs(path)

    Super-rmdir; remove a leaf directory and all empty intermediate

    ones.  Works like rmdir except that, if the leaf directory is

I have a production setup consisting of django and web server apache2.

I'm using apache2 to serve my static files so I didn't configure anything my django settings which means I left MEDIA_URL and MEDIA_ROOT blank

The full path to my media file is and permission

/home/tests/media/ 
drwxrwxrwx 3 www-data www-data 4096 Jun 15 16:08 .

I directed my models field to store all pictures at and this also has full permission and running on same group as your Python process

/home/tests/media/hello
drwxrwxrwx 3 www-data www-data 4096 Jun 15 16:08 .

this is my apache.conf

WSGIPythonEggs /tmp

WSGIScriptAlias / /home/tests/tests/wsgi.py
WSGIPythonPath /home/tests

<Directory /home/tests>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>


Alias /media/ /home/tests/media/
<Directory /home/tests/media/>
Order deny,allow
Allow from allow
</Directory>

Alias /static/ /home/tests/static/
<Directory /home/tests/static/>
Order deny,allow
Allow from all

drwxrwxrwx 3 www-data www-data 4096 Jun 15 16:08 .

settings.py

MEDIA_ROOT = ''


MEDIA_URL = ''

Can someone help me please

1

1 Answers

1
votes

I don't know why you think you should leave the media settings blank. MEDIA_ROOT should be /home/tests/media.