File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 88import dj_database_url
99from django .contrib .messages import constants as messages
1010
11- if os .environ .get ('DEVELOPMENT' ):
11+ if os .environ .get ('DEVELOPMENT' ) == '1' :
1212 development = True
1313 print ('DEVELOPMENT=TRUE' )
1414else :
4646 'rest_framework' ,
4747 'crispy_forms' ,
4848 'checkout' ,
49+ 'storages' ,
4950]
5051
5152MIDDLEWARE = [
132133# Static files (CSS, JavaScript, Images)
133134# https://docs.djangoproject.com/en/1.11/howto/static-files/
134135
135- STATIC_URL = '/static/'
136+ AWS_S3_OBJECT_PARAMETERS = {
137+ 'Expires' : 'Thu, 31 Dec 2099 20:00:00 GMT' ,
138+ 'CacheControl' : 'max-age=94608000'
139+ }
140+
141+ AWS_STORAGE_BUCKET_NAME = 'django-issue-tracker-1'
142+ AWS_S3_REGION_NAME = 'eu-west-1'
143+ AWS_ACCESS_KEY = os .environ .get ("AWS_ACCESS_KEY_ID" )
144+ AWS_SECRET_ACCESS = os .environ .get ("AWS_SECRET_ACCESS_KEY" )
145+ AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
136146
147+ STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
148+
149+ STATIC_URL = '/static/'
137150STATICFILES_DIRS = (os .path .join (BASE_DIR , 'static' ), )
138151STATIC_ROOT = (os .path .join (BASE_DIR , 'staticfiles' ))
139152
You can’t perform that action at this time.
0 commit comments