title: AWS S3 + Django: Files stored in S3 accesible by user
body: <p>I have a (django) web application running in my own server. It has users, permissions and all that.</p>
  
  <p>Each user is able to upload files to my  platform. A new entry is created in my DB for each file uploaded and the file is then stored in AWS S3.</p>
  
  <p>Currently the bucket is set to public, so this means that anyone has access to any file in the bucket if they know the url, which is not ideal.</p>
  
  <p>What i want to do is to restrict the access to the files so that only the user who uploaded it has access to them (and only when they are logged in to my platform).</p>
  
  <p>Does anyone know if there is a solution for this? If so, how?</p>
  
  <p>I have been looking into this, but i still have no clue how to implement it or if it is actually what im looking for.
  <a href="http://blogs.aws.amazon.com/security/post/Tx1P2T3LFXXCNB5/Writing-IAM-policies-Grant-access-to-user-specific-folders-in-an-Amazon-S3-bucke" rel="noreferrer">http://blogs.aws.amazon.com/security/post/Tx1P2T3LFXXCNB5/Writing-IAM-policies-Grant-access-to-user-specific-folders-in-an-Amazon-S3-bucke</a></p>