Skip to content

Commit 66b98be

Browse files
author
Bojan Jovanovic
committed
Made bucket name configurable through ENVVAR + Runtime bumped to latest 3.6 python
1 parent a5f9cba commit 66b98be

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

pyconbalkan/core/storage.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
from time import time
33

4+
from django.conf import settings
45
from django.core.files.storage import FileSystemStorage
56
from storages.backends.s3boto3 import S3Boto3Storage
67

@@ -27,7 +28,7 @@ def generate_filename(self, filename):
2728

2829

2930
class S3Storage(UniqueNameMixin, S3Boto3Storage):
30-
bucket_name = "pyconbalkan-us"
31+
bucket_name = settings.AWS_S3_BUCKET_NAME
3132

3233

3334
class LocalStorage(UniqueNameMixin, FileSystemStorage):

pyconbalkan/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
AWS_S3_SECRET_ACCESS_KEY = config("AWS_S3_SECRET_ACCESS_KEY", "")
207207
AWS_S3_ACCESS_KEY_ID = config("AWS_S3_ACCESS_KEY_ID", "")
208208
AWS_S3_REGION_NAME = config("AWS_S3_REGION_NAME", "")
209+
AWS_S3_BUCKET_NAME = config("AWS_S3_BUCKET_NAME", "pyconbalkan-us")
209210
AWS_QUERYSTRING_AUTH = config("AWS_QUERYSTRING_AUTH", cast=bool, default=False)
210211

211212
LOGIN_URL = '/admin/'

runtime.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.6.5
1+
python-3.6.13

0 commit comments

Comments
 (0)