You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2020-07-28-django-amazon-s3-uploader.md
+40
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,46 @@ categories: [python, django]
7
7
8
8
Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services that provides object storage through a web service interface. Amazon S3 uses the same scalable storage infrastructure that Amazon.com uses to run its global e-commerce network.
9
9
10
+
#### AWS S3 Configuration
11
+
12
+
> Before you can begin using Boto 3 (for AWS S3), you should set up authentication credentials.
13
+
> in this case, AWS S3 Only for upload files or images purpose.
14
+
15
+
16
+
**a. Using awscli _(recommended)_**
17
+
18
+
```
19
+
$ sudo apt-get install -y awscli
20
+
$ aws configure set aws_access_key_id {{access_key}}
21
+
$ aws configure set aws_secret_access_key {{secret_key}}
22
+
$ aws configure set region {{region_name}} # e.g: ap-southeast-1
23
+
```
24
+
25
+
**b. Manual Configuration**
26
+
27
+
```
28
+
$ mkdir ~/.aws && nano ~/.aws/credentials
29
+
```
30
+
31
+
and then fill:
32
+
33
+
```
34
+
[default]
35
+
aws_access_key_id = xxxx
36
+
aws_secret_access_key = xxxx
37
+
```
38
+
39
+
You may also want to set a default region of your server. The `ap-southeast-1` depend with your server region.
40
+
This can be done in the configuration file. By default, its location is at `~/.aws/config`:
41
+
42
+
```
43
+
[default]
44
+
region=ap-southeast-1
45
+
```
46
+
47
+
-----------------
48
+
49
+
10
50
This example below is one of way "how to integrate" the AmazonS3 with Django _(with django-rest-framework)_.
0 commit comments