2011-07-18 96 views
0

Django管理頁面上出現以下隱含錯誤消息。有人認爲他們知道哪裏出了問題嗎?Django管理頁面上的IO錯誤

如果它有幫助(這可能是不相關的),圖像領域似乎是拒絕所有的東西都是腐敗的或者不是圖像。

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

好像django無法找到特定的文件或目錄。也許從ImageField的圖像丟失圖像? –

回答

0

'〜/文件/程序/ Django的/ cozycuisine /媒體'

我不認爲你可以使用~,嘗試一個完整的絕對路徑,看看會發生什麼。