开发者

Is there a way to display any media, regardless of type? (especially in Django?)

开发者 https://www.devze.com 2023-01-24 17:03 出处:网络
If I have a .mp4 file, it will automatically 开发者_运维百科display a video (flash?) If it\'s a jpg, it\'ll just display the image...

If I have a .mp4 file, it will automatically 开发者_运维百科display a video (flash?) If it's a jpg, it'll just display the image...

Edit: I want this embedded inside a webpage.


As eternicode says, all you need to do is make your views the normal way and pass the querysets to your template.

In the template , all you need to do is load the content from your query as part of /media as defined in your settings.py e.g

<img src="/media/{{model.object}}" width="135" height="60" alt="thumbnail" />


no, you must have file view generator,

thats mean you have list of pic and video and then for each file generate correct player and tag

its easy


You need specify the "Content-Type" in the http response header.

0

精彩评论

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