title: Permissions on django media directory
body: <p>This may be a question for server fault but since it involves a django app, here goes:</p>
  
  <p>I have a django app that allows files to be uploaded to the media directory via file upload fields. </p>
  
  <pre><code>def content_file_name(instance, filename):
      return '/'.join([ instance.client, instance.job_number, instance.post_type + "_" + instance.post_round, instance.job_number + "-" + instance.cell_number, filename])
  
  class PostEntry(models.Model):
          ...
          add_pdf = models.NullBooleanField()
          link_pdf = models.FileField(upload_to=content_file_name, blank=True, null=True)
          add_html = models.NullBooleanField()
          link_html = models.FileField(upload_to=content_file_name, blank=True, null=True)
          add_zip = models.NullBooleanField()
          link_zip = models.FileField(upload_to=content_file_name, blank=True, null=True)
          ...
  </code></pre>
  
  <p>I've also made the media directory available to other users via ftp. Although I've set the permissions on the media directory to allow read, write and execute recursively on all files and subdirectories within it, it still won't allow ftp operations on any subdirectory django creates after I've set permissions. Which is to say, if I access my newly created subdirectory (within my media directory) through an ftp client, I don't, by default, have privileges to drag a file into, or delete a file from said directory.</p>
  
  <p>In settings, I've set the FILE_UPLOAD_PERMISSIONS option at 0644. As I expected, it made no difference. Is there ANY way to set django so that it creates directories that can be written to outside of the application? Or is this behavior that has to be set at the OS level?</p>