In Python, how do I check that a file is a text file?
Not all sequences of bytes are valid for ex. UTF-8, maybe you should check this?
The file is uploaded through a Django form. The contents of the file need to be saved into a models.TextField(), for editors to review it before publication.
I am already checking UploadedFile.content_type. I have considered using a regular input field, but as the text is going to be quite long, it would be unwieldy for users to cut and paste.