File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ Step 1. Create S3 Buckets
2
+ Step 2. Create Folder uploads
3
+ Step 3. Try Manual File Upload
4
+ Step 4. Try to Access File manually
5
+ Step 5. Change to Public Setting
6
+ Step 6. Add Policy Setting
7
+ {
8
+ "Version": "2012-10-17",
9
+ "Statement": [
10
+ {
11
+ "Sid": "AllowPublicReadGetObject",
12
+ "Effect": "Allow",
13
+ "Principal": "*",
14
+ "Action": "s3:GetObject",
15
+ "Resource": "arn:aws:s3:::supercoder-bucket/*"
16
+ }
17
+ ]
18
+ }
19
+
20
+ Step 7: Then Access File
21
+ Step 8: Create IAM User with S3 Access
22
+ Step 9: Create Server Key
23
+ Step 10: Setup Django API for Upload File in S3
24
+
25
+ Step 11: Create Django API
26
+
27
+ Install pip install boto3 django-storages
28
+
29
+ Add in Settings.py
30
+
31
+ import os
32
+ from storages.backends.s3boto3 import S3Boto3Storage
33
+
34
+ # AWS S3 settings
35
+ AWS_ACCESS_KEY_ID = 'YOUR_ACCESS_ID'
36
+ AWS_SECRET_ACCESS_KEY = 'AWS_SECRET_ACCESS_KEY'
37
+ AWS_STORAGE_BUCKET_NAME = 'AWS_STORAGE_BUCKET_NAME'
38
+ AWS_S3_REGION_NAME = 'AWS_S3_REGION_NAME' # e.g., 'us-east-1'
39
+
You can’t perform that action at this time.
0 commit comments