16π
It was AWS S3 access problem.
In S3 bucket console, I edited bucketβs public access as public.
NB : Only do this if your intention is to make the file publicly available for example of youβre using it to serve files for your website, like images, css etc things that everyone needs to have access to.
23π
Setting AWS_DEFAULT_ACL = None
worked for me. It looks like boto requests public-read
ACL by default so unless you have made your bucket public it wonβt work.
- [Django]-InvalidBasesError: Cannot resolve bases for [<ModelState: 'users.GroupProxy'>]
- [Django]-Output of values() on a QuerySet with ManyToMany fields
- [Django]-Django: timezone.now vs timezone.now()
10π
If anyone is still having these issues, The problem is on the AWS SΒ£ bucket and You can fix the problem by enabling ACL on the s3 bucket. To do that,
- Go to your S3 Bucket>Permissions Tab
- Scroll down to
Object Ownership
and click on Edit - Change the settings from ACL disabled to ACL enabled and save changes
- [Django]-What's the best way to store a phone number in Django models?
- [Django]-Writing a __init__ function to be used in django model
- [Django]-How to remove all relations from manytomany?
6π
This worked for me:
In my S3 bucket -> Permissions Tab -> click Block public access -> Edit -> untick Block all public access -> Save
AND
In my AWS IAM settings -> Users Tab (under Access Management) -> <my-user> -> Add Permissions -> add AmazonS3FullAccess
This granted the user (identified by AWS id and AWS secret) access to control my s3 buckets
- [Django]-How to allow only one radio button to be checked?
- [Django]-How to delete an app from a django project
- [Django]-Django won't refresh staticfiles
1π
By default when you create a new bucket all the public access of s3 objects are blocked(it is ticked by default). that is,you can not access the objects(read, write) through any public apiβs or apps(like django apps). so, if you want to access s3 objects in the particular bucket you should set the permission to be publicly accessible(see the permission section of bucket). For further control you can add ACL(Access control list) users from the ACL section.
you can refer to this link
- [Django]-How can one change the type of a Django model field from CharField to ForeignKey?
- [Django]-Rendering a template variable as HTML
- [Django]-Is there an easy way to populate SlugField from CharField?
1π
It is Access Control List(ACL)
Buckets -> Permission -> ACL -> Edit -> tick Everyone(public access) List and Read for Objects and bucket ACL
- [Django]-How to resize an ImageField image before saving it in python Django model
- [Django]-Invalid block tag: 'static'
- [Django]-What's the best solution for OpenID with Django?
1π
If you are still experiencing these difficulties, the issue lies with the AWS S3 bucket. You can resolve the problem by enabling Access Control List (ACL) on the S3 bucket. Follow the steps below to make the necessary changes:
- Navigate to your S3 Bucket and click on the "Permissions" tab.
- Scroll down to the section labeled "Object Ownership" and select the "Edit" option.
- Modify the settings from "ACL disabled" to "ACL enabled" and save the changes.
- [Django]-Django request get parameters
- [Django]-How to process a form (via get or post) using class-based views?
- [Django]-Using Django Rest Framework, how can I upload a file AND send a JSON payload?
0π
For me the issue was wrong environment variables.
# settings file
AWS_S3_ACCESS_KEY_ID = os.environ["AWS_S3_ACCESS_KEY_ID"]
AWS_S3_SECRET_ACCESS_KEY = os.environ["AWS_S3_SECRET_ACCESS_KEY"]
AWS_S3_ACCESS_KEY_ID="random-key-id"
AWS_S3_SECRET_ACCESS_KEY="random-access-key"
After I removed the double quotes I ran the command again. It works now.
- [Django]-Matching query does not exist Error in Django
- [Django]-Django β No such table: main.auth_user__old
- [Django]-Django Rest frameworks: request.Post vs request.data?
- [Django]-Chained method calls indentation style in Python
- [Django]-Better ArrayField admin widget?
- [Django]-Track the number of "page views" or "hits" of an object?