This Django app adds a new field type, ConstrainedFileField, that has the capability of checking the document size and type.
conda install phygbu::django-constrainedfilefield