Created
July 13, 2012 21:21
-
-
Save chroto/3107564 to your computer and use it in GitHub Desktop.
Django - detect MIME type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for file in mixed_files %} | |
<a href="" | |
{% if "image" in file|mimetype %}class="fancybox"{% endif %} | |
{% if "pdf" in file|mimetype %}rel="external"{% endif %} | |
>foo</a> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment