File tree 5 files changed +12
-5
lines changed
5 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ PYTHON_VERSION=3.9.6
6
6
# Django
7
7
# ------------------------------------------------------------------------------
8
8
SECRET_KEY =
9
+ DJANGO_LOG_LEVEL =
10
+ DRF_API_LOGGER_DATABASE =
9
11
10
12
# EMAIL
11
13
# ------------------------------------------------------------------------------
Original file line number Diff line number Diff line change 386
386
}
387
387
388
388
DRF_API_LOGGER_DATABASE = os .getenv ("DRF_API_LOGGER_DATABASE" , False )
389
- DRF_LOGGER_QUEUE_MAX_SIZE = int (os .getenv ("DRF_LOGGER_QUEUE_MAX_SIZE" , 50 )) # Default to 50 if not specified.
390
- DRF_LOGGER_INTERVAL = int (os .getenv ("DRF_LOGGER_INTERVAL" , 10 )) # In Seconds, Default to 10 seconds if not specified.
391
- DRF_API_LOGGER_DEFAULT_DATABASE = os .getenv ("DRF_API_LOGGER_DEFAULT_DATABASE" , "default" )
389
+ # DRF_LOGGER_QUEUE_MAX_SIZE = int(os.getenv("DRF_LOGGER_QUEUE_MAX_SIZE", 50)) # Default to 50 if not specified.
390
+ # DRF_LOGGER_INTERVAL = int(os.getenv("DRF_LOGGER_INTERVAL", 10)) # In Seconds, Default to 10 seconds if not specified.
391
+ # DRF_API_LOGGER_DEFAULT_DATABASE = os.getenv("DRF_API_LOGGER_DEFAULT_DATABASE", "default")
392
392
DRF_API_LOGGER_PATH_TYPE = os .getenv ("DRF_API_LOGGER_PATH_TYPE" , "FULL_PATH" )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ aniso8601==7.0.0
2
2
appdirs == 1.4.4
3
3
asgiref == 3.3.4
4
4
black == 21.5b2
5
+ bleach == 6.2.0
5
6
boto3 == 1.17.109
6
7
botocore == 1.20.109
7
8
certifi == 2021.5.30
@@ -29,6 +30,7 @@ django-truncate==0.1
29
30
django-versatileimagefield == 2.1
30
31
djangorestframework == 3.12.4
31
32
djangorestframework-simplejwt == 4.7.2
33
+ drf-api-logger == 1.1.16
32
34
drf-flex-fields == 0.9.1
33
35
drf-yasg == 1.20.0
34
36
dynaconf == 3.1.4
@@ -81,3 +83,4 @@ typing-extensions==3.10.0.0
81
83
uritemplate == 3.0.1
82
84
urllib3 == 1.26.6
83
85
validators == 0.18.2
86
+ webencodings == 0.5.1
Original file line number Diff line number Diff line change 21
21
22
22
23
23
def upload_path (instance , filename : str ) -> str :
24
- return "/" .join (["images" , str (instance .name ), filename ])
24
+ return "/" .join ([str (instance .name ), filename ])
25
25
26
26
27
27
def rand_slug () -> str :
28
28
return "" .join (
29
29
random .choice (string .ascii_letters + string .digits ) for _ in range (6 )
30
30
)
31
31
32
+ def get_default_image ():
33
+ return settings .MEDIA_ROOT + "/images/default_placeholder.png"
32
34
33
35
class Category (MPTTModel ):
34
36
"""
@@ -177,7 +179,7 @@ class Image(models.Model):
177
179
ppoi_field = "image_ppoi" ,
178
180
# null=True,
179
181
# blank=True,
180
- default = settings . MEDIA_ROOT + "/images/default_placeholder.png" ,
182
+ default = get_default_image ,
181
183
placeholder_image = OnDiscPlaceholderImage (
182
184
path = settings .MEDIA_ROOT + "/images/default_placeholder.png"
183
185
),
You can’t perform that action at this time.
0 commit comments