diff options
author | syn <isaqtm@gmail.com> | 2020-03-23 10:42:48 +0300 |
---|---|---|
committer | syn <isaqtm@gmail.com> | 2020-03-23 10:42:48 +0300 |
commit | 27bccdea5d5e376fdecb27b03f692408a2cc1f99 (patch) | |
tree | 99f927303fa7bb1928c0e5c5ae7b400c74790148 /config.py | |
parent | 3ff1340efb5956c9b417c6e03c6bab5684dda384 (diff) | |
download | blure-27bccdea5d5e376fdecb27b03f692408a2cc1f99.tar.gz |
* Fix hardcoded url
* Improve resizing
Diffstat (limited to 'config.py')
-rw-r--r-- | config.py | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,5 +1,6 @@ from uuid import UUID from os import environ +from pathlib import Path host = '0.0.0.0' port = 80 @@ -12,14 +13,16 @@ PG_URI = f'postgres://{pg_user}:{pg_pass}@pg' APP_SECRET = UUID('8036587d-11ea-4c59-af9b-9da52eded1bc').bytes -NGX_IMAGE_PATH = '/var/ngx_img/{}' -NGX_IMAGE_URL = '/ngx_img/{}' -CUT_SIZES = [ - (256, 256), - (512, 512), - (1024, 1024), - (2048, 2048), -] +NGX_IMAGE_PATH = Path('/var/ngx_img') +NGX_IMAGE_URL = Path('/ngx_img') + +CUT_SIZES = { + 's': (256, 256), + 'm': (512, 512), + 'l': (1024, 1024), + 'xl': (2048, 2048) + # 'o': <original> +} DELETE_FILE_ON_DELETE = False NOT_FOUND_IMAGE_CONTENT_TYPE = 'image/jpeg' |