开发者

how to set django static image

I have a view and template called index.html.

I have a image which is broken form.I saw django docs,which was n't clear to me.

How do,i make my image to appear.I m asking ,while development.image is in开发者_JAVA百科 ,this URL /home/logic/quote/hummingbird.gif'


Your question is not really clear but I suspect that you are having trouble serving static files using the Django built-in web server. Have a look at the following StackOverflow Questions:

  1. Django and Serving Static Files
  2. How does Django serve media files?
  3. Django: how do you serve media / stylesheets and link to them within templates


what about writing an inclusion tag that makes something simmilar to:

if settings.debug=True:
    return localimage
else:
    return serverimage
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜