Форум сайта python.su
я новичок в django
пытаюсь через админку загрузить изображение, получаю следующую ошибку
OSError at /admin/teacher_profile/teacher/add/ (13, 'Permission denied')
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/teacher_profile/teacher/add/
Exception Type: OSError
Exception Value: (13, 'Permission denied')
Exception Location: /usr/lib/python2.6/os.py in makedirs, line 157
Python Executable: /usr/bin/python
Python Version: 2.6.2
Python Path: ['/home/radik/Programming/django_projects/school',
'/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg',
'/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/var/lib/python-support/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/var/lib/python-support/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/usr/local/lib/python2.6/dist-packages']
Server time: Thu, 13 Aug 2009 14:34:32 -0500
from django.db import models
class Teacher(models.Model):
..................................
headshot = models.ImageField(upload_to='/home/Programming/django_projects/school/media/images/teachers')
..................................
Офлайн
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to
читаем первую строку 10 раз
Офлайн
slav0nicsettings.py
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to
читаем первую строку 10 раз
# Absolute path to the directory that holds media.
MEDIA_ROOT = '/home/Programming/django_projects/school/media/'
.............
headshot = models.ImageField(upload_to='images/teachers')
.............
Офлайн
images/teachers создан? 777 права поставил?
Офлайн