2016-02-10 40 views
0

我使用FileBrowser上傳圖像文件。在我settings.py我設置Django-filebrowser不正確的圖像網址

from filebrowser.sites import site 
site.storage.location = SITE_ROOT + "/static/memes_images/" 

和filebrowser正確地上傳文件到這個目錄。但問題是在文件瀏覽器文件列表中的圖像縮略圖。縮略圖不顯示, 因爲它試圖從鏈接http://localhost:8000/admin/filebrowser/browse/name.jpg顯示它。正確的鏈接是http://localhost:8000/static/memes_images/name.jpg。我嘗試將其設置在settings.py

site.storage.url = "http://localhost:8000/static/memes_images" 

,但是當我將它設置,FileBrowser使用空字符串作爲圖像的URL,而不是這個http://localhost:8000/static/memes_images/name.jpg

如何更改FileBrowser使用的圖像URL?

回答

0

我遇到同樣的問題。但設置MEDIA_ROOT和MEDIA_URL有幫助。

+0

你可以請更具體一點嗎?也許給出一個理由爲什麼這有助於,或者以何種方式幫助。 – ZGski