boto S3ResponseError: 400 Bad Request
<p>I'm deploying my Django application on Ubuntu of EC2 on AWS.</p>

<p>I finished all the jobs needed but connecting to boto.</p>

<p>In my <code>settings.py</code></p>

<pre><code>AWS_ACCESS_KEY = 'AWS_ACCESS_KEY'
AWS_SECRET_ACCESS_KEY = 'AWS_SECRET_ACCESS_KEY'
AWS_STORAGE_BUCKET_NAME = 'BUCKET-s3'
AWS_QUERYSTRING_AUTH = False
S3_URL = 'https://s3.ap-northeast-2.amazonaws.com/%s' % AWS_STORAGE_BUCKET_NAME

DEFAULT_FILE_STORAGE = 'PROJECT.s3utils.MediaS3BotoStorage'
STATICFILES_STORAGE = 'PROJECT.s3utils.StaticRootS3BotoStorage'
MEDIA_URL = S3_URL + '/media/'
STATIC_URL = S3_URL + '/static/'

MEDIA_ROOT = MEDIA_URL
STATIC_ROOT = STATIC_URL
</code></pre>

<p><strong><em><code>'PROJECT.s3utils.py' is below:</code></em></strong></p>

<pre><code>from storages.backends.s3boto import S3BotoStorage
StaticRootS3BotoStorage = lambda: S3BotoStorage(location='static') # s3 directory name
class MediaS3BotoStorage(S3BotoStorage):
    location = 'media'
</code></pre>

<p>Finally, I need to set up configuration file for connecting boto.</p>

<p>Without anything, when I command 'python manage.py collectstatic' , the error shows this message : </p>

<blockquote>
  <p>boto.exception.NoAuthHandlerFound: No handler was ready to
  authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check
  your credentials</p>
</blockquote>

<p>So I did add configuration file at <strong><em><code>'~/.boto'</code></em></strong> as below:</p>

<pre><code>[Credentials]
AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY
</code></pre>

<p>After creating configuration file ~/.boto, I did command 'python manage.py collectstatic'</p>

<p>I got an error :</p>

<blockquote>
  <p>boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request</p>
</blockquote>

<p>What I do is following the boto document : <a href="http://boto.cloudhackers.com/en/latest/getting_started.html" rel="nofollow noreferrer">http://boto.cloudhackers.com/en/latest/getting_started.html</a></p>

<p><a href="https://i.stack.imgur.com/nSsK2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nSsK2.png" alt="enter image description here"></a></p>

<p>Is there anything I am missing now? </p>