Skip to content

Commit

Permalink
updating environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-gray-tangent committed Jul 23, 2024
1 parent ccf81cd commit 1a4bcbd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ EMAIL_HOST_USER=''
EMAIL_HOST_PASSWORD=''
EMAIL_BACKEND_CONSOLE='True/False'
EMAIL_USE_TLS=True
SECRET_KEY=''
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ About the project:

---

### How to setup SECRET_KEY in Development

.env file

SECRET_KEY=''

To generate a new secret key, you can use the following command:

1. python3 manage.py shell
2. from django.core.management.utils import get_random_secret_key
3. print(get_random_secret_key())

---

### Using Makefile

1. Clone the repository
Expand All @@ -34,7 +48,7 @@ About the project:

.env file

* EMAIL_HOST='sandbo x.smtp.mailtrap.io'
* EMAIL_HOST='sandbo x.smtp.mailtrap.io'
* EMAIL_HOST_USER='*********'
* EMAIL_HOST_PASSWORD='******'
* EMAIL_PORT='2525'
Expand Down Expand Up @@ -75,4 +89,5 @@ Docker Volumes for production:
### Email Settings in Production

.env file

* EMAIL_BACKEND_CONSOLE=False
9 changes: 3 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This is is meant for local development, but should give an idea of what you
# This is meant for local development, but should give an idea of what you
# can consider in production.
version: '3.8'

services:
db:
Expand Down Expand Up @@ -32,15 +31,13 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
# TODO: dollar signs in the KEY are interpolated, therefore escaped here
# with double "$$". Maybe move to .env file to simplify?
- SECRET_KEY='django-insecure-w!h85bp^$$e8gm%c23r!0%9i7yzd=6w$$s&ic+6!%306&kj8@k*5'
- SECRET_KEY=${SECRET_KEY}
- DEBUG=True
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=term_db # see POSTGRES_DB above
- DB_USER=sadilar # see POSTGRES_USER above
- DB_PASSWORD=sadilar # see POSTGRES_PASSWORD above
- DB_PASSWORD=${DB_PASSWORD}
- TESTING_DIR=/app/general/tests/files/
- FEATURE_FLAG=search_feature
- EMAIL_HOST=${EMAIL_HOST-}
Expand Down

0 comments on commit 1a4bcbd

Please sign in to comment.