Soroush Hakami
Soroush Hakami

Reputation: 5396

500-error when adding a picture

In Django-CMS, I select the picture plugin and add a picture from my harddrive, then when I click on that picture-plugin I get the error as seen below. What is the reason for this?

    ValueError at /admin/cms/page/2/edit-plugin/7/cms_page_media/2/parking_mockup.png/
invalid literal for int() with base 10: '2/edit-plugin/7/cms_page_media/2/parking_mockup.png'
Request Method: GET
Request URL:    http://localhost:8000/admin/cms/page/2/edit-plugin/7/cms_page_media/2/parking_mockup.png/
Django Version: 1.3.1
Exception Type: ValueError
Exception Value:    
invalid literal for int() with base 10: '2/edit-plugin/7/cms_page_media/2/parking_mockup.png'
Exception Location: C:\Python27\lib\site-packages\django\db\models\fields\__init__.py in get_prep_value, line 479
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.2
Python Path:    
['C:\\djangoworkspace\\hulawai',
 'C:\\Python27\\lib\\site-packages\\django_classy_tags-0.3.4.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_sekizai-0.5-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\html5lib-0.95-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\virtualenv-1.7.1.2-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\pip-1.1-py2.7.egg',
 'C:\\Windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages',
 'C:\\Python27\\lib\\site-packages\\PIL']
Server time:    Thu, 22 Mar 2012 11:03:58 +0100
Traceback Switch to copy-and-paste view

C:\Python27\lib\site-packages\django\core\handlers\base.py in get_response
                    for middleware_method in self._view_middleware:
                        response = middleware_method(request, callback, callback_args, callback_kwargs)
                        if response:
                            break
                if response is None:
                    try:
                        response = callback(request, *callback_args, **callback_kwargs) ...
                    except Exception, e:
                        # If the view raised an exception, run it through exception
                        # middleware, and if the exception middleware returns a
                        # response, use that. Otherwise, reraise the exception.
                        for middleware_method in self._exception_middleware:
                            response = middleware_method(request, e)

UPDATE Full stacktrace available here: https://gist.github.com/2157837

Upvotes: 1

Views: 478

Answers (1)

Soroush Hakami
Soroush Hakami

Reputation: 5396

I edited my settings.py

From

MEDIA_URL = 'media/'

To

MEDIA_URL = 'http://localhost:8000/media/'

Upvotes: 1

Related Questions