title: Adding a file through Django shell
body: <p>Django 1.11.6</p>
  
  <p>I am trying to save a file through Django shell. Could you have a look at the traceback and tell me what I do wrongly?</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>class ItemFile(ChecksumMixin,
                 models.Model):
      item = models.ForeignKey(Item,
                               on_delete=models.PROTECT,
                               verbose_name=_("item"))
  
  
      file = models.FileField(blank=False,
                              max_length=255,
                              upload_to=get_item_path,
                              verbose_name=_("file"))
  </code></pre>
  
  <p><strong>In the shell:</strong></p>
  
  <pre><code>from django.core.files import File
  f = File('/home/michael/PycharmProjects/photoarchive_4/general/static/test/text_1.pdf', 'rb')
  i = Item.objects.get(pk=1)
  
  ItemFile.objects.create(item=i, file=f)
  </code></pre>
  
  <p><strong>Traceback:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1059, in &lt;listcomp&gt;
      for obj in self.query.objs
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1058, in &lt;listcomp&gt;
      [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1008, in pre_save_val
      return field.pre_save(obj, add=True)
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/db/models/fields/files.py", line 296, in pre_save
      file.save(file.name, file.file, save=False)
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/db/models/fields/files.py", line 94, in save
      self.name = self.storage.save(name, content, max_length=self.field.max_length)
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/core/files/storage.py", line 54, in save
      return self._save(name, content)
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/core/files/storage.py", line 351, in _save
      for chunk in content.chunks():
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/core/files/base.py", line 81, in chunks
      data = self.read(chunk_size)
    File "/home/michael/PycharmProjects/venv/photoarchive_4/lib/python3.6/site-packages/django/core/files/utils.py", line 16, in &lt;lambda&gt;
      read = property(lambda self: self.file.read)
  AttributeError: 'str' object has no attribute 'read'
  </code></pre>