django static files loading error in aws-s3 buscket
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
here is my aws conf file:
import datetime
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_FILE_EXPIRE = 200
AWS_PRELOAD_METADATA = True
AWS_QUERYSTRING_AUTH = True
DEFAULT_FILE_STORAGE = 'monetimes.aws.utils.MediaRootS3BotoStorage'
STATICFILES_STORAGE = 'monetimes.aws.utils.StaticRootS3BotoStorage'
AWS_STORAGE_BUCKET_NAME = 'monetimes-static-bucket'
S3DIRECT_REGION = 'ap-south-1'
S3_URL = '//%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
MEDIA_URL = '//%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME
MEDIA_ROOT = MEDIA_URL
STATIC_URL = S3_URL + 'static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
two_months = datetime.timedelta(days=61)
date_two_months_later = datetime.date.today() + two_months
expires = date_two_months_later.strftime("%A, %d %B %Y 20:00:00 GMT")
AWS_HEADERS = {
'Expires': expires,
'Cache-Control': 'max-age=%d' % (int(two_months.total_seconds()), ),
}
AWS_QUERYSTRING_AUTH = True
I am putting my static files to aws-s3 buket by making it full access and in public mode.
static files are coming and copying to my aws-s3 bucket but showing some errors.
please check the above screen-shot for the error.
I am adding key and secret key properly also
by default in my s3 bucket it is coming asia-mumbai location.
and i am procedding with the same
django amazon-web-services amazon-s3
add a comment |
here is my aws conf file:
import datetime
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_FILE_EXPIRE = 200
AWS_PRELOAD_METADATA = True
AWS_QUERYSTRING_AUTH = True
DEFAULT_FILE_STORAGE = 'monetimes.aws.utils.MediaRootS3BotoStorage'
STATICFILES_STORAGE = 'monetimes.aws.utils.StaticRootS3BotoStorage'
AWS_STORAGE_BUCKET_NAME = 'monetimes-static-bucket'
S3DIRECT_REGION = 'ap-south-1'
S3_URL = '//%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
MEDIA_URL = '//%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME
MEDIA_ROOT = MEDIA_URL
STATIC_URL = S3_URL + 'static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
two_months = datetime.timedelta(days=61)
date_two_months_later = datetime.date.today() + two_months
expires = date_two_months_later.strftime("%A, %d %B %Y 20:00:00 GMT")
AWS_HEADERS = {
'Expires': expires,
'Cache-Control': 'max-age=%d' % (int(two_months.total_seconds()), ),
}
AWS_QUERYSTRING_AUTH = True
I am putting my static files to aws-s3 buket by making it full access and in public mode.
static files are coming and copying to my aws-s3 bucket but showing some errors.
please check the above screen-shot for the error.
I am adding key and secret key properly also
by default in my s3 bucket it is coming asia-mumbai location.
and i am procedding with the same
django amazon-web-services amazon-s3
Can you tell us what versions of boto and storages you are using? As a quick fix, try settingAWS_S3_SIGNATURE_VERSION='s3v4'
.
– RishiG
Jan 3 at 15:36
boto3==1.9.71 botocore==1.12.71 Django==2.1.4 django-storages==1.7.1
– soubhagya
Jan 3 at 15:55
add a comment |
here is my aws conf file:
import datetime
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_FILE_EXPIRE = 200
AWS_PRELOAD_METADATA = True
AWS_QUERYSTRING_AUTH = True
DEFAULT_FILE_STORAGE = 'monetimes.aws.utils.MediaRootS3BotoStorage'
STATICFILES_STORAGE = 'monetimes.aws.utils.StaticRootS3BotoStorage'
AWS_STORAGE_BUCKET_NAME = 'monetimes-static-bucket'
S3DIRECT_REGION = 'ap-south-1'
S3_URL = '//%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
MEDIA_URL = '//%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME
MEDIA_ROOT = MEDIA_URL
STATIC_URL = S3_URL + 'static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
two_months = datetime.timedelta(days=61)
date_two_months_later = datetime.date.today() + two_months
expires = date_two_months_later.strftime("%A, %d %B %Y 20:00:00 GMT")
AWS_HEADERS = {
'Expires': expires,
'Cache-Control': 'max-age=%d' % (int(two_months.total_seconds()), ),
}
AWS_QUERYSTRING_AUTH = True
I am putting my static files to aws-s3 buket by making it full access and in public mode.
static files are coming and copying to my aws-s3 bucket but showing some errors.
please check the above screen-shot for the error.
I am adding key and secret key properly also
by default in my s3 bucket it is coming asia-mumbai location.
and i am procedding with the same
django amazon-web-services amazon-s3
here is my aws conf file:
import datetime
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_FILE_EXPIRE = 200
AWS_PRELOAD_METADATA = True
AWS_QUERYSTRING_AUTH = True
DEFAULT_FILE_STORAGE = 'monetimes.aws.utils.MediaRootS3BotoStorage'
STATICFILES_STORAGE = 'monetimes.aws.utils.StaticRootS3BotoStorage'
AWS_STORAGE_BUCKET_NAME = 'monetimes-static-bucket'
S3DIRECT_REGION = 'ap-south-1'
S3_URL = '//%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
MEDIA_URL = '//%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME
MEDIA_ROOT = MEDIA_URL
STATIC_URL = S3_URL + 'static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
two_months = datetime.timedelta(days=61)
date_two_months_later = datetime.date.today() + two_months
expires = date_two_months_later.strftime("%A, %d %B %Y 20:00:00 GMT")
AWS_HEADERS = {
'Expires': expires,
'Cache-Control': 'max-age=%d' % (int(two_months.total_seconds()), ),
}
AWS_QUERYSTRING_AUTH = True
I am putting my static files to aws-s3 buket by making it full access and in public mode.
static files are coming and copying to my aws-s3 bucket but showing some errors.
please check the above screen-shot for the error.
I am adding key and secret key properly also
by default in my s3 bucket it is coming asia-mumbai location.
and i am procedding with the same
django amazon-web-services amazon-s3
django amazon-web-services amazon-s3
edited Jan 3 at 14:26


Akber Iqbal
3,20851428
3,20851428
asked Jan 3 at 14:22
soubhagyasoubhagya
1078
1078
Can you tell us what versions of boto and storages you are using? As a quick fix, try settingAWS_S3_SIGNATURE_VERSION='s3v4'
.
– RishiG
Jan 3 at 15:36
boto3==1.9.71 botocore==1.12.71 Django==2.1.4 django-storages==1.7.1
– soubhagya
Jan 3 at 15:55
add a comment |
Can you tell us what versions of boto and storages you are using? As a quick fix, try settingAWS_S3_SIGNATURE_VERSION='s3v4'
.
– RishiG
Jan 3 at 15:36
boto3==1.9.71 botocore==1.12.71 Django==2.1.4 django-storages==1.7.1
– soubhagya
Jan 3 at 15:55
Can you tell us what versions of boto and storages you are using? As a quick fix, try setting
AWS_S3_SIGNATURE_VERSION='s3v4'
.– RishiG
Jan 3 at 15:36
Can you tell us what versions of boto and storages you are using? As a quick fix, try setting
AWS_S3_SIGNATURE_VERSION='s3v4'
.– RishiG
Jan 3 at 15:36
boto3==1.9.71 botocore==1.12.71 Django==2.1.4 django-storages==1.7.1
– soubhagya
Jan 3 at 15:55
boto3==1.9.71 botocore==1.12.71 Django==2.1.4 django-storages==1.7.1
– soubhagya
Jan 3 at 15:55
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54024184%2fdjango-static-files-loading-error-in-aws-s3-buscket%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54024184%2fdjango-static-files-loading-error-in-aws-s3-buscket%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you tell us what versions of boto and storages you are using? As a quick fix, try setting
AWS_S3_SIGNATURE_VERSION='s3v4'
.– RishiG
Jan 3 at 15:36
boto3==1.9.71 botocore==1.12.71 Django==2.1.4 django-storages==1.7.1
– soubhagya
Jan 3 at 15:55