title: Django - how to make ImageField/FileField optional?
body: <pre><code>class Product(models.Model):
      ...    
      image = models.ImageField(upload_to=generate_filename, blank=True)  
  </code></pre>
  <p>When I use <code>ImageField(blank=True)</code> and do not select image into admin form, an exception occurs.</p>
  <p>In django code you can see this:</p>
  <pre><code>class FieldFile(File):
     ....
  
      def _require_file(self):
          if not self:
              raise ValueError(&quot;The '%s' attribute has no file associated with it.&quot; % self.field.name)
  
      def _get_file(self):
          self._require_file()
          ...
  </code></pre>
  <p>Django trac has ticket #13327 about this problem, but seems it can't be fixed soon. How to make these field optional?</p>