2013-10-15 51 views
0

我想安裝Django的ckeditor,並有一些麻煩。一切工作正常, 圖像上傳 - 但他們沒有顯示。我在文件上收到404錯誤(我確信它在那裏)。 以下是調試控制檯,文件夾和html頁面的截圖。如何用django-ckeditor顯示圖像?

enter image description here

請幫助我,我還是性學習的,老實說,我甚至不知道去哪裏找。

回答

0

documentation明確提到如何設置媒體網址。所以視圖函數將爲開發期間用戶上傳的文件提供服務。

加入這個片段

#urls.py 

from django.conf import settings 
from django.conf.urls.static import static 

urlpatterns = patterns('', 
    # ... the rest of your URLconf goes here ... 
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)