Django: FileField with ContentType and File Size Validation
24th September 2010 in Coding
Immagine that you need to add the possibility to upload a PDF or Zip file in the django admin, but you want to be sure your client will upload only these two filetypes and not other ones.
You might also need the same functionality in the frontend, so why not use "ModelForm" and have just one validation for both applications (admin and frontend)?
In this short post I'll share with you my simple solution.
continue reading "Django: FileField with ContentType and File Size Validation"