2012-03-22 114 views
1

在Django-CMS中,我選擇了圖片插件並從我的硬盤添加了一張圖片,然後當我點擊該圖片插件時,出現如下所示的錯誤。這是什麼原因?添加圖片時出現500錯誤

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完整堆棧跟蹤可在這裏:https://gist.github.com/2157837

+0

請引用全文請 – jpic 2012-03-22 11:32:39

+0

@jpic通過指向完整日誌的鏈接 – 2012-03-22 11:38:32

回答

1

我編輯settings.py

MEDIA_URL = 'media/' 

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