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 the path I have set in the MEDIA_URL ?
问问题
618 次
1 回答
0
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/'
于 2011-03-05T13:48:26.230 回答