System Variables

The following django system variables are required by NearBeach;

  • SECRET_KEY

  • ALLOWED_HOSTS

  • CSRF_TRUSTED_URLS

  • DB_DATABASE

  • DB_ENGINE

  • DB_HOST

  • DB_PASSWORD

  • DB_PORT

  • DB_USER

Blob Storage

Azure

AZURE_STORAGE_CONNECTION_STRING

Please refer to the Microsoft Azure documentation for setting up and obtaining the connection string.

Example:

  • AZURE_STORAGE_CONNECTION_STRING=defaultendpointsprotocol=https;accountname=accountname;accountkey=accountkey;endpointsuffix=core.windows.net/

AZURE_STORAGE_CONTAINER_NAME

The name of the Azure Blob storage

Example:

  • AZURE_STORAGE_CONTAINER_NAME=blobstorage

S3/Minio

For setup of AWS S3 connections, please refer to the AWS IAMS documentation

For setup of Minio connections, please refer to the Minio Access Control documentation

For any Boto3 information, please refer to the Boto3 documentation

AWS_ACCESS_KEY_ID

This references the Access Key Id

Example:

  • AWS_ACCESS_KEY_ID=hfOlT4DrY9VkyiMLCKn9

AWS_SECRET_ACCESS_KEY

This references the Secret Access Key

Example:

  • AWS_SECRET_ACCESS_KEY=sET3GI24o3sn3mFiFbIMUGyz9CrgdqIOot011THy

AWS_STORAGE_BUCKET_NAME

This references the S3 Bucket name

Example:

  • AWS_STORAGE_BUCKET_NAME=NearBeachBucket

AWS_S3_ENDPOINT_URL

This references the S3 Endpoint url

Example:

  • AWS_S3_ENDPOINT_URL=http://localhost:9000

  • AWS_S3_ENDPOINT_URL=https://s3.bucket.nearbeach.cloudstorage.com

Database

DB_DATABASE

More information on Django Databases can be found on their documentation. This represent the name of the database.

No default is set, user will need to set.

Example:

  • DB_DATABASE=nearbeach_db

DB_ENGINE

More information on Django Databases can be found on their documentation. This represent the database engine.

No default is set, user wil need to set.

Example:

  • DB_ENGINE=postgresql <- Connects to a Postgres Database

  • DB_ENGINE=mysql <- Connects to either a MySQL or MariaDb database

  • DB_ENGINE= <- Connects to a Postgres Database

  • DB_ENGINE=oracle <- Connects to an Oracle Database

DB_HOST

More information on Django Databases can be found on their documentation. This represents the location of the database.

No default is set, user wil need to set.

Example:

  • DB_HOST=127.0.0.1 <- Connects to a database at localhost

  • DB_HOST=nearbeach-db.cloudservices.hosting <- Connects to a database at nearbeach-db.cloudservices.hosting

DB_PASSWORD

More information on Django Databases can be found on their documentation. This is the password for the database.

No default is set, user wil need to set.

Example:

  • DB_PASSWORD=mysecretpassword

DB_PORT

More information on Django Databases can be found on their documentation. This represent the port for the database.

No default is set, user wil need to set.

Example:

  • DB_PORT=3306

  • DB_PORT=5432

DB_USER

More information on Django Databases can be found on their documentation. This is the username for the database.

No default is set, user wil need to set.

Example:

  • DB_USER=nearbeach_db_user

Django System Variables

SECRET_KEY

More information can be located on the Django Documentation. We recommend setting up this variable using the following information from this Humberto’s blog

ALLOWED_HOSTS

More information can be located on the Django Documentation.

Allowed Hosts should reference which URLs will be connected to the NearBeach system. If there are multiple URLs, each url can be separated by a commar. Do not include the http or port number

Default will allow ALL hosts - we do not recomment

Example:

  • - ALLOWED_HOST=demo.nearbeach.org

  • - ALLOWED_HOST=demo.nearbeach.org,test.nearbeach.org

  • - ALLOWED_HOST=localhost,127.0.0.1

CSRF_TRUSTED_URLS

More information can be located on the Django Documentation.

Csrf trusted urls should reference the exact urls form submissions will be coming from. If there are multiple URLs, each url can be separated by a commar. Please include the http/https and, if required, port number.

Default will allow ALL hosts - we do not recommend.

Example:

  • CSRF_TRUSTED_URLS=https://demo.nearbeach.org

  • CSRF_TRUSTED_URLS=https://demo.nearbeach.org,https://test.nearbeach.org:8080

  • CSRF_TRUSTED_URLS=http://localhost:8000,http://127.0.0.1:8000

DEBUG

Default will be false. Only use this on production to debug an issue.

DOCUMENTATION_CLEAN_UP

Used to notify the system to run periodic checks to clean up the Blob storage from any documenation that does not current have a link to any object within NearBeach. It is designed so that old documentation that has been removed, is cleaned from the BLOB storage.

Default will be false.

Example:

  • DOCUMENTATION_CLEAN_UP=True

  • DOCUMENTATION_CLEAN_UP=False

DOCUMENTATION_CLEAN_AFTER_DAYS

Used to notify the system the PERIOD on which to run the document clean up process.

Default will be 90 days

Example:

  • DOCUMENTATION_CLEAN_AFTER_DAYS=120 <- cleaned up every 120 days

  • DOCUMENTATION_CLEAN_AFTER_DAYS=365 <- cleaned up once a year

  • DOCUMENTATION_CLEAN_AFTER_DAYS=7 <- cleaned up each week

MAX_FILE_SIZE_UPLOAD

The maximum size for a file to be uploaded in bytes.

Default will be 104857600 bytes (104mb)

Example:

  • MAX_FILE_SIZE_UPLOAD=1048 <- 1kb

  • MAX_FILE_SIZE_UPLOAD=1048000 <- 1mb

  • MAX_FILE_SIZE_UPLOAD=1048000000 <- 1Gb

Human Readable Value

MAX_FILE_UPLOAD

Notes

100MB

104857600

Default Value

10MB

10485760

1GB

1048576000

SESSION_SAVE_EVERY_REQUEST

More information can be located on the Django Documentation.

Default will be false.

Example:

  • DOCUMENTATION_CLEAN_UP=True

  • DOCUMENTATION_CLEAN_UP=False

Email/SMTP

More information on Django SMTP can be found on their documentation

SMTP_EMAIL_HOST

The SMTP host

Example:

  • SMTP_EMAIL_HOST=email-smtp.us-east-2.amazonaws.com

  • SMTP_EMAIL_HOST=smtp.gmail.com

SMTP_EMAIL_PORT

SMTP Email Port

Example:

  • SMTP_EMAIL_PORT=465

SMTP_EMAIL_HOST_USER

SMTP Email host user

Example:

  • SMTP_EMAIL_USER=smtpuser

SMTP_EMAIL_HOST_PASSWORD

SMTP Email Host password

Example:

  • SMTP_EMAIL_PASSWORD=secretPassword