Skip to content

Instantly share code, notes, and snippets.

@ErDmKo
Created October 11, 2013 15:49
Show Gist options
  • Save ErDmKo/6937135 to your computer and use it in GitHub Desktop.
Save ErDmKo/6937135 to your computer and use it in GitHub Desktop.
Python content_type get from django datebase field
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