title: How to ensure file exists in Django project?
body: <p>My question is simple as the title clearly describes it.</p>
  <p>I have <code>FileField</code> in some models, I added a property method to check the existence of file:</p>
  <pre><code>@property
  def file_exists(self):
      # Because sometimes, the field may contain the string path
      # but the file doesn't exist at all in the server
      if file: # if the string path exists
          return os.path.exists(self.file.path) # If the file exists in server
  </code></pre>
  <p>This works perfectly in development, but when I migrate all my files on AWS, it raises an Error such I don't have permission to do that.</p>
  <p>I wonder what's wrong, or Is there another way to test whether a file exists?</p>