Skip to content

Configuration

Daniel Dupriest edited this page Mar 9, 2019 · 6 revisions

SMTP server and email settings

Reimbursinator uses an SMTP email server to send completed reports to both administrators and users. By default these settings are set up to use a gmail account, and are separated from the Django settings file and stored in the back/.env environment file loaded automatically when pipenv starts.

To use the existing .env file with gmail

If using a gmail account, the file's variables are entered as follows:

EMAIL_HOST_USER is the gmail address of the account you will use to send emails from Reimbursinator.

EMAIL_HOST_PASSWORD is the password of the gmail account

SUBMIT_REPORT_DESTINATION_EMAIL is the email address to which you would like completed reports to be sent.

SUBMIT_REPORT_FROM_EMAIL is the address reports will appear to be sent from.

To not use the .env file

The .env file can be skipped entirely if you don't plan to use pipenv or wish to enter values manually.

"To:" and "From:" addresses are set in the back/backend/view.py file within the send_report_to_admin function. Email server configuration can be found in the back/reimbursinator/settings.py file under the # Email config section.

Cross-origin Resource Sharing

This project comes with Django configured to allow cross-origin resource sharing with certain hosts. This should be configured to reflect the host or hosts which will be serving the front end content.

This is configured in back/reimbursinator/settings.py as follows:

CORS_ORIGIN_WHITELIST = (
    'localhost:8443',
    '192.168.99.100:8443',
    '127.0.0.1:8443',
)

Allow-all option and other settings are available at the django-cors-headers project page

Django administration web document server

The Django administration interface uses CSS and JS files served from a static folder. In this project's Docker configuration these files are served from the admin/ container using nginx on port 8445. To configure Django to use this setup, change the following line in back/reimbursinator/settings.py to match the address of the server.

STATIC_URL = https://192.168.99.100:8445

Clone this wiki locally