Skip to content

Commit

Permalink
Implementation for django-configurations (#43)
Browse files Browse the repository at this point in the history
* Added django-configurations

* Refactored to use django-configurations fully, removed python-decouple

* Typos
  • Loading branch information
thejoeejoee committed Feb 22, 2022
1 parent 4659876 commit 4352d12
Show file tree
Hide file tree
Showing 20 changed files with 426 additions and 335 deletions.
6 changes: 3 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SECRET_KEY=...
DEBUG=false
PUBLIC_URL=https://fiesta.localhost
DJANGO_DEBUG=false
DJANGO_LOG_LEVEL=INFO
DJANGO_SECRET_KEY=
PUBLIC_URL=https://fiesta.localhost
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ upd: ## Runs all needed docker containers in detached mode
up: ## Runs all needed docker containers
docker-compose up

produp: export DEBUG = False ## Runs fiesta in production mode.
produp: export DJANGO_CONFIGURATION = LocalProduction ## Runs fiesta in production mode.
produp:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml --profile prod up --build

Expand Down
10 changes: 5 additions & 5 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
web:
command: './manage.py collectstatic --noinput && ./manage.py runserver 0.0.0.0:8000'
environment:
DEBUG: "false"
DJANGO_CONFIGURATION: Production

webserver:
command: [ nginx, '-g', 'daemon off;' ]
Expand All @@ -22,8 +22,8 @@ services:
- "443:443"

# remove profiles so production env does have filled elastic search
elastic:
profiles: [ ]
# elastic:
# profiles: [ ]

wikifetcher:
profiles: [ ]
# wikifetcher:
# profiles: [ ]
5 changes: 0 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
- 8000
env_file:
- ./fiesta/.env.base
secrets:
- .env
build:
context: .
Expand Down Expand Up @@ -132,10 +131,6 @@ services:
- .env
- wiki/.env.base

secrets:
.env:
file: ./.env

volumes:
postgres_data:
elastic_data:
Expand Down
6 changes: 3 additions & 3 deletions fiesta/.env.base
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BUILD_DIR=/usr/src/build
STATIC_DIR=/usr/src/static
MEDIA_DIR=/usr/src/media
DJANGO_BUILD_DIR=/usr/src/build
DJANGO_STATIC_ROOT=/usr/src/static
DJANGO_MEDIA_ROOT=/usr/src/media
2 changes: 1 addition & 1 deletion fiesta/apps/files/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def upload_to(instance: BaseModel, filename: str) -> str:
except AttributeError:
modified = now().isoformat()

return hashlib.md5(f"{instance.pk}-{modified}".encode()).hexdigest()
return hashlib.sha256(f"{instance.pk}-{modified}".encode()).hexdigest()
299 changes: 0 additions & 299 deletions fiesta/fiesta/settings.py

This file was deleted.

Loading

0 comments on commit 4352d12

Please sign in to comment.