Skip to content

Commit

Permalink
update post
Browse files Browse the repository at this point in the history
  • Loading branch information
agusmakmun committed Aug 7, 2020
1 parent c1acd5b commit bd7da19
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions _posts/2020-07-28-django-amazon-s3-uploader.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,46 @@ categories: [python, django]

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.

#### AWS S3 Configuration

> Before you can begin using Boto 3 (for AWS S3), you should set up authentication credentials.
> in this case, AWS S3 Only for upload files or images purpose.

**a. Using awscli _(recommended)_**

```
$ sudo apt-get install -y awscli
$ aws configure set aws_access_key_id {{access_key}}
$ aws configure set aws_secret_access_key {{secret_key}}
$ aws configure set region {{region_name}} # e.g: ap-southeast-1
```

**b. Manual Configuration**

```
$ mkdir ~/.aws && nano ~/.aws/credentials
```

and then fill:

```
[default]
aws_access_key_id = xxxx
aws_secret_access_key = xxxx
```

You may also want to set a default region of your server. The `ap-southeast-1` depend with your server region.
This can be done in the configuration file. By default, its location is at `~/.aws/config`:

```
[default]
region=ap-southeast-1
```

-----------------


This example below is one of way "how to integrate" the AmazonS3 with Django _(with django-rest-framework)_.

```
Expand Down

0 comments on commit bd7da19

Please sign in to comment.