Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
5d2620b6
Commit
5d2620b6
authored
7 years ago
by
florimondmanca
Browse files
Options
Downloads
Patches
Plain Diff
add warnings in aws conf
parent
06dcf15d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
aws/conf.py
+14
-16
14 additions, 16 deletions
aws/conf.py
with
14 additions
and
16 deletions
aws/conf.py
+
14
−
16
View file @
5d2620b6
...
...
@@ -6,35 +6,33 @@ See:
"""
import
os
import
warnings
# Use S3 backends
DEFAULT_FILE_STORAGE
=
'
aws.backends.MediaBackend
'
# Uncomment STATICFILES_STORAGE to store static files on AWS
# Beware that Heroku automatically calls 'manage.py collectstatic' for
# each deployment, and this backend does not support checking for pre-existing
# static files on AWS : all the static files will be uploaded on each
# deployment.
# It can be OK to set DISABLE_COLLECTSTATIC on Heroku, but then
# you'd have to run collectstatic manually on Heroku when necessary.
# Since static files on the backend should not change a lot, it seems OK
# to simply use the default file storage for static files.
# STATICFILES_STORAGE = 'aws.backends.StaticBackend'
# Credentials
AWS_ACCESS_KEY_ID
=
os
.
environ
.
get
(
'
AWS_ACCESS_KEY_ID
'
)
AWS_SECRET_ACCESS_KEY
=
os
.
environ
.
get
(
'
AWS_SECRET_ACCESS_KEY
'
)
# Name of the storage bucket
AWS_STORAGE_BUCKET_NAME
=
os
.
environ
.
get
(
'
AWS_STORAGE_BUCKET_NAME
'
)
# Region of the storage bucket (e.g. eu-west-1)
AWS_S3_REGION_NAME
=
os
.
environ
.
get
(
'
AWS_S3_REGION_NAME
'
)
# Do not overwrite files with the same name
AWS_S3_FILE_OVERWRITE
=
False
# Warn if any of the above is not set
if
not
AWS_ACCESS_KEY_ID
:
warnings
.
warn
(
'
AWS_ACCESS_KEY_ID not set
'
)
if
not
AWS_SECRET_ACCESS_KEY
:
warnings
.
warn
(
'
AWS_SECRET_ACCESS_KEY not set
'
)
if
not
AWS_STORAGE_BUCKET_NAME
:
warnings
.
warn
(
'
AWS_STORAGE_BUCKET_NAME not set
'
)
if
not
AWS_S3_REGION_NAME
:
warnings
.
warn
(
'
AWS_S3_REGION_NAME not set
'
)
# Overwrite files with the same name
AWS_S3_FILE_OVERWRITE
=
True
# Use the new signature version
AWS_S3_SIGNATURE_VERSION
=
'
s3v4
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment