#68: Using dotenv for a proper unix config file

This commit is contained in:
Daniel Quinn
2016-03-03 17:59:27 +00:00
parent 4d685ee424
commit 0aead1fbe6
5 changed files with 17 additions and 7 deletions

View File

@@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/1.9/ref/settings/
import os
from dotenv import load_dotenv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -140,6 +142,16 @@ STATIC_URL = '/static/'
MEDIA_URL = "/media/"
# Paperless-specific stuff
# You shouldn't have to edit any of these values. Rather, you can set these
# values in /etc/paperless.conf instead.
# ----------------------------------------------------------------------------
# Tap paperless.conf if it's available
if os.path.exists("/etc/paperless.conf"):
load_dotenv("/etc/paperless.conf")
# Logging
LOGGING = {
@@ -159,10 +171,6 @@ LOGGING = {
}
# Paperless-specific stuff
# Change these paths if yours are different
# ----------------------------------------------------------------------------
# The default language that tesseract will attempt to use when parsing
# documents. It should be a 3-letter language code consistent with ISO 639.
OCR_LANGUAGE = "eng"