How do I fix this image upload error in my website? Site is built on Python
Question: My site, which is built on Python/Postgresql with django, has an area where
you can upload an image. When I try to upload an image on it, nothing happens
and I receive this error message notification via e-mail:

> 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)}>


Answer: You neeed to install [PIL](http://www.pythonware.com/products/pil/), if you
have installed pip, you only need to install it with:

    
    
    pip install pil
    

But do you could need some libraries like libjpeg62-dev

