A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
#68: Using dotenv for a proper unix config file
Daniel Quinn0aead1fbe657
diff --git a/docs/changelog.rst b/docs/changelog.rstindex ce2a4edab..772e30dc0 100644--- a/docs/changelog.rst+++ b/docs/changelog.rst@@ -3,6 +3,8 @@ Changelog* 0.1.1 (master)+ * `#68`_: Added support for using a proper config file at+ ``/etc/paperless.conf``.* Refactored the Vagrant installation process to use environment variablesrather than asking the user to modify ``settings.py``.* `#44`_: Harmonise environment variable names with constant names.@@ -79,3 +81,4 @@ Changelog.. _#54: https://github.com/danielquinn/paperless/issues/54.. _#57: https://github.com/danielquinn/paperless/issues/57.. _#60: https://github.com/danielquinn/paperless/issues/60+.. _#68: https://github.com/danielquinn/paperless/issues/68diff --git a/requirements.txt b/requirements.txtindex 810af8ec2..6a133327a 100644--- a/requirements.txt+++ b/requirements.txt@@ -1,6 +1,7 @@Django==1.9.2django-extensions==1.6.1djangorestframework==3.3.2+python-dotenv==0.3.0filemagic==1.6langdetect==1.0.5Pillow==3.1.1diff --git a/scripts/paperless-consumer.service b/scripts/paperless-consumer.serviceindex 34d65dedb..79a27d3ce 100644--- a/scripts/paperless-consumer.service+++ b/scripts/paperless-consumer.service@@ -2,10 +2,9 @@Description=Paperless consumer[Service]-EnvironmentFile=/etc/conf.d/paperlessUser=paperlessGroup=paperless-ExecStart=/home/paperless/project/virtualenv/bin/python /home/paperless/project/src/manage.py document_consumer -v $PAPERLESS_CONSUMPTION_VERBOSITY+ExecStart=/home/paperless/project/virtualenv/bin/python /home/paperless/project/src/manage.py document_consumer[Install]WantedBy=multi-user.targetdiff --git a/scripts/paperless-webserver.service b/scripts/paperless-webserver.serviceindex 1a2386471..9d20f5a1c 100644--- a/scripts/paperless-webserver.service+++ b/scripts/paperless-webserver.service@@ -2,7 +2,6 @@Description=Paperless webserver[Service]-EnvironmentFile=/etc/conf.d/paperlessUser=paperlessGroup=paperlessExecStart=/home/paperless/project/virtualenv/bin/python /home/paperless/project/src/manage.py runserver 0.0.0.0:8000diff --git a/src/paperless/settings.py b/src/paperless/settings.pyindex 1599a08e8..f2fb41941 100644--- a/src/paperless/settings.py+++ b/src/paperless/settings.py@@ -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")++# LoggingLOGGING = {@@ -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"