title: How to upload large files in Django?
body: <p>Using the default FileField, an upload from the admin page for a model will only be successful if the given image file is very small. Otherwise an error will be thrown:</p>
  
  <blockquote>
    <p>Using the URLconf defined in astrobanana.urls, Django tried these URL patterns, in this order:<br>
    1. ^$ [name='index']<br>
    2. ^(?P\d+)/$ [name='comic']<br>
    ... etc etc ...<br></p>
    
    <p>The current URL, 500.shtml, didn't match any of these.<br></p>
  </blockquote>
  
  <p>Note that I once used ImageField, but in an attempt to solve the problem, I switched to using FileField, thinking that perhaps django was prohibiting an image from being uploaded because it did not read it as an image.</p>
  
  <p>Needless to say, I am confused.  Small images work and large images throw a cryptic error. Everything relevant in settings.py seems to be defined and proper, especially seeing as small images upload properly.  However, here are my current relevant settings for reference.</p>
  
  <pre><code>MEDIA_ROOT = '/home/astroban/public_html/astrobanana/media/'
  MEDIA_URL = 'http://astrobanana.com/media/'
  FILE_UPLOAD_HANDLERS = (
          'django.core.files.uploadhandler.MemoryFileUploadHandler',
          'django.core.files.uploadhandler.TemporaryFileUploadHandler',
          )
  
  FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440
  FILE_UPLOAD_PERMISSIONS = None
  FILE_UPLOAD_TEMP_DIR = None
  </code></pre>
  
  <p>In addition, here is the code for the model in question:</p>
  
  <pre><code>    from django.db import models
  
      class ComicPost(models.Model):
          title = models.CharField(max_length=150)
          comic = models.FileField(upload_to='comics/')
          hovertext = models.CharField(max_length=150,blank=True,null=True)
          timestamp = models.DateTimeField()
          hits = models.IntegerField(editable=False,default=0)
          def save(self, *args, **kwargs):
              if not self.id:
                  i = ComicPost.objects.all().order_by('-id')[0]
                  self.id = i.id+1
              super(ComicPost, self).save(*args, **kwargs)
          def __unicode__(self):
              return self.title
          class Meta:
              ordering = ('-timestamp',)
  </code></pre>
  
  <p>... And here is the admin.py:</p>
  
  <pre><code>    from django.contrib import admin
      from astrobanana.comic.models import ComicPost
  
      class ComicPostAdmin(admin.ModelAdmin):
          list_display = ('title','timestamp','hits')
  
      admin.site.register(ComicPost,ComicPostAdmin)
  </code></pre>
  
  <p>Everything seems pretty standard.  What's wrong with any of this?  Any help is appreciated I've racked my brains.</p>