title: Django max_upload_size gets ignored
body: <p>I have this code but for some reason the file size gets ignored, even if I set this directly to ('max_upload_size', 5242880) at formatChecker.py the value seems to get ignored after the upload has happened.</p>
  <p>settings.py</p>
  <pre><code>MAX_UPLOAD_SIZE = &quot;5242880&quot;
  </code></pre>
  <p>formatChecker.py</p>
  <pre><code>from django.db.models import FileField
  from django.forms import forms
  from django.template.defaultfilters import filesizeformat
  from django.utils.translation import ugettext_lazy as _
  from myproject.settings import MAX_UPLOAD_SIZE
  
  
  class ContentTypeRestrictedFileField(FileField):
      &quot;&quot;&quot;
      Same as FileField, but you can specify:
          * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg']
          * max_upload_size - a number indicating the maximum file size allowed for upload.
              2.5MB - 2621440
              5MB - 5242880
              10MB - 10485760
              20MB - 20971520
              50MB - 5242880
              100MB 104857600
              250MB - 214958080
              500MB - 429916160
      &quot;&quot;&quot;
  
      def __init__(self, *args, **kwargs):
          self.content_types = kwargs.pop('content_types', [])
  
          super(ContentTypeRestrictedFileField, self).__init__(*args, **kwargs)
  
      def clean(self, *args, **kwargs):
          data = super(ContentTypeRestrictedFileField, self).clean(*args, **kwargs)
  
          file = data.file
          try:
              content_type = file.content_type
              if content_type in self.content_types:
                  if file._size &gt; int(MAX_UPLOAD_SIZE):
                      raise forms.ValidationError(_('Please keep filesize under %s. Current filesize %s') % (
                          filesizeformat(MAX_UPLOAD_SIZE), filesizeformat(file._size)))
              else:
                  raise forms.ValidationError(_('Filetype not supported.'))
          except AttributeError:
              pass
          return data
  </code></pre>
  <p>models.py</p>
  <pre><code>...
  class Post(models.Model):
      postattachment = ContentTypeRestrictedFileField(
        blank=True,
        null=True,
        upload_to=get_file_path_user_uploads,
        content_types=['application/pdf',
                       'application/zip',
                       'application/x-rar-compressed',
                       'application/x-tar',
                       'image/gif',
                       'image/jpeg',
                       'image/png',
                       'image/svg+xml',
                       ]
       )
  ...
  </code></pre>
  <p>Any idea why that problem occurs?
  Did I forget something here?</p>