开发者

django / ImageKit - showing absolute path to images

I'm using the ImageKit and for some reason it's displaying the absolute path to images. Any idea how to make it to display t开发者_Python百科he path I have set in the MEDIA_URL ?


The problem is in Models with the ImageKit's cache_dir seting. If you put a slash in front of your path and have the absolute path to your images then when you pull the images in your template it will show the absolute path to your images:

cache_dir = '/mymedia/myimages/cache/'

But if you take the front slash off from your path and not include the folder mentioned in MEDIA_URL (in settings.py) then the problem with the reference to the absolute path goes away:

cache_dir = 'myimages/cache/'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜