Skip to content

Commit bd7da19

Browse files
committed
update post
1 parent c1acd5b commit bd7da19

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

_posts/2020-07-28-django-amazon-s3-uploader.md

+40
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,46 @@ categories: [python, django]
77

88
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.
99

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+
1050
This example below is one of way "how to integrate" the AmazonS3 with Django _(with django-rest-framework)_.
1151

1252
```

0 commit comments

Comments
 (0)