Skip to content

Commit

Permalink
add email environment variables to the instructions and settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Simurgan committed Dec 25, 2023
1 parent f44b078 commit ee02e3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion project/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Please be sure your database server is running before run the container. You can

To run the container,
- `docker run -p 8000:8000 <your-tag>`

The first port number (8000) is the port number of your machine your service runs. Please be sure that the specified port is available. The second one is your container's port number and should be same as the one exported in the Dockerfile. (8000 for this project.)

Dont forget to set the following environment variables,
Expand All @@ -21,6 +21,9 @@ Dont forget to set the following environment variables,
- DATABASE_PASSWORD: should be the password of the owner of the created database, for root user: postgres
- DATABASE_HOST: should be the address of your database server, in local: 127.0.0.1
- DATABASE_PORT: should be the port number of your database server, default: 5432
- EMAIL_HOST_USER: should be a real gmail email address, this is for sending user's email notifications
- EMAIL_HOST_PASSWORD: should be the password of the gmail email address used as EMAIL_HOST_USER
- ADMIN_EMAIL: should be the same as EMAIL_HOST_USER

You can set them while running the container like the following
- `docker run -p 8000:8000 -e DJANGO_SECRET_KEY=<your-secret-key> <your-tag>`
Expand Down
6 changes: 3 additions & 3 deletions project/backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'sciencecollabplatform@gmail.com'
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_PASSWORD')
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_USE_TLS = True
ADMIN_EMAIL='sciencecollabplatform@gmail.com'
ADMIN_EMAIL = os.environ.get('ADMIN_EMAIL')
EMAIL_USE_SSL = False
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
Expand Down

0 comments on commit ee02e3b

Please sign in to comment.