2012-06-13 54 views
0

我的網站使用django在Python/Postgresql上構建,有一個可以上傳圖片的區域。當我嘗試上傳圖片就可以了,什麼也沒有發生,我通過電子郵件收到此錯誤信息通知:如何在我的網站上修復此圖片上傳錯誤?網站建立在Python之上

Traceback (most recent call last):

File ".. /lib/python/django/core/handlers/b ase.py ", line 85, in get_response response = callback(request, *callback_args, **callback_kwargs)

File 「../lib/python/django/contrib/auth/de corators.py ", line 67, in call return self.view_func(request, *args, **kwargs)

File ".. /app/bmwrr/views/assessment.py ", line 231, in upload_assessment_media import Image

ImportError: No module named Image

, POST:, COOKIES:{'sessionid': '1918628422885ccc8265fe7f9229332f'}, META:{'CONTENT_LENGTH': '1741174', 'CONTENT_TYPE': 'multipart/form-data; boundary=---- WebKitFormBoundary5S1a4kvt7BfnTMgl', 'DOCUMENT_ROOT': '/home/bmwrr/www.sitename.com/app/bmwrr', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch', 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_CONTENT_LENGTH': '1741174', 'HTTP_COOKIE': 'sessionid=1918628422885ccc8265fe7f9229332f', 'HTTP_HOST': 'sitename.com', 'HTTP_ORIGIN': 'http://sitename.com', 'HTTP_REFERER': 'http://sitename.com/assessment/4127/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/ 536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'PATH_INFO': '/assessment/upload/4127/', 'PATH_TRANSLATED': '../app/bmwrr/assessment/upload/4127/' , 'QUERY_STRING': '', 'REDIRECT_STATUS': '200', 'REDIRECT_URI': '/app.fcgi/assessment/upload/4127/', 'REMOTE_ADDR': '108.36.115.245', 'REMOTE_PORT': '49482', 'REQUEST_METHOD': 'POST', 'REQUEST_URI': '/assessment/upload/4127/', 'SCRIPT_FILENAME': '/home/bmwrr/www.sitename.com/app/bmwrr/app.fcgi' , 'SCRIPT_NAME': '/app.fcgi', 'SERVER_ADDR': '108.179.XXX.XXX', 'SERVER_NAME': ‘sitename.com', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'lighttpd/1.4.28', 'wsgi.errors': , 'wsgi.input': , 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}>

+1

你試圖導入一個叫做'Image'模塊,該命名空間是不知道的。 –

回答

1

您neeed安裝PIL,如果你已經安裝了點子,你只需要與安裝:

pip install pil 

但是你可能需要像一些庫中的libjpeg62-dev的

+0

非常感謝您的幫助!即使安裝了jpeg開發工具,我現在也遇到了一些庫問題,但是我會把它放在另一篇文章中。 –

相關問題