0

我想使用 solr_thumbnail 生成缩略图,但出现错误。我已按照教程生成缩略图并保存在缓存文件夹下。但现在它正在寻找/home/vaibhav/TRAC/flipdiscounts/flipdiscounts/flipdiscountApp/images/cache/b2/f7/b2f7287e13292d73659a0fde830ef197.jpg/

urls.py:

url(r'^images/(?P<path>.*)/$', 'django.views.static.serve',                                 # For store image
        {'document_root': MEDIA_ROOT, 'show_indexes': False}),        

有人能帮我吗 ...

4

1 回答 1

0

尝试将您的 MEDIA_ROOT 根设置为/home/vaibhav/TRAC/flipdiscounts/flipdiscounts/flipdiscountApp/images/

并将您的 MEDIA_URL 设置为/images/

并在您的 urls.py 中使用它

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

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
于 2013-08-22T14:35:58.983 回答