Created
October 11, 2013 15:49
-
-
Save ErDmKo/6937135 to your computer and use it in GitHub Desktop.
Python content_type get from django datebase field
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
import magic | |
with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as m: | |
content_type = m.id_filename(self.file._get_path()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment