我在Django管理页面上收到以下隐秘的错误消息。有谁认为他们知道出了什么问题?
如果它有所帮助(这可能是无关的),那么图像区域似乎拒绝了所有损坏或不是图像的内容。
Request Method: GET
Request URL: http://localhost:8000/admin/cozcus/event/
Django Version: 1.3
Exception Type: IOError
Exception Value:
(2, 'No such file or directory')
Exception Location: /Library/Python/2.6/site-packages/django/core/files/storage.py in _open, line 159
Python Executable: /usr/bin/python
Python Version: 2.6.1
Python Path:
['/Users/morgan/Documents/programming/django/cozycuisine',
'/Library/Python/2.6/site-packages/simplegeo-3.0.115-py2.6.egg',
'/Library/Python/2.6/site-packages/simplejson-2.1.6-py2.6.egg',
'/Library/Python/2.6/site-packages/ipaddr-2.1.9-py2.6.egg',
'/Library/Python/2.6/site-packages/oauth2-1.5.170-py2.6.egg',
'/Library/Python/2.6/site-packages/httplib2-0.7.1-py2.6.egg',
'/Library/Python/2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg',
'/Library/Python/2.6/site-packages/pyfacebook-1.0a2-py2.6.egg',
'/Library/Python/2.6/site-packages/pip-1.0.1-py2.6.egg',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old',
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload',
'/Library/Python/2.6/site-packages',
'/Library/Python/2.6/site-packages/PIL',
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC',
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac- unicode']
Server time: Mon, 18 Jul 2011 13:40:37 -0500
下面我有我的模特:
class Event(models.Model):
event_key = models.CharField(max_length = 10, unique = True)
title = models.CharField(max_length=200)
date = models.DateField()
time = models.TimeField()
food_type = models.CharField(max_length = 400)
address = models.CharField(max_length = 200)
city = models.CharField(max_length = 100)
state = models.CharField(max_length = 50)
zipcode = models.IntegerField()
country = models.CharField(max_length = 50, blank = True)
host = models.ForeignKey(User, related_name = 'host')
guests = models.ManyToManyField(User, related_name = 'guest')
image = models.ImageField(height_field = 'image_height', width_field = 'image_width', upload_to = '~/documents/programming/django/cozycuisine/media', blank = True, null = True)
image_height = models.IntegerField(blank = True, null = True)
image_width = models.IntegerField(blank = True, null = True)
def __unicode__(self):
return self.title
`
答案 0 :(得分:0)
'〜/文档/编程/ django的/ cozycuisine /媒体'
我认为你不能使用~
,尝试一个完整的绝对路径,看看会发生什么。