mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
#68: Using dotenv for a proper unix config file
This commit is contained in:
parent
4d685ee424
commit
0aead1fbe6
@ -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 variables
|
||||
rather 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/68
|
||||
|
@ -1,6 +1,7 @@
|
||||
Django==1.9.2
|
||||
django-extensions==1.6.1
|
||||
djangorestframework==3.3.2
|
||||
python-dotenv==0.3.0
|
||||
filemagic==1.6
|
||||
langdetect==1.0.5
|
||||
Pillow==3.1.1
|
||||
|
@ -2,10 +2,9 @@
|
||||
Description=Paperless consumer
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/conf.d/paperless
|
||||
User=paperless
|
||||
Group=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.target
|
||||
|
@ -2,7 +2,6 @@
|
||||
Description=Paperless webserver
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/conf.d/paperless
|
||||
User=paperless
|
||||
Group=paperless
|
||||
ExecStart=/home/paperless/project/virtualenv/bin/python /home/paperless/project/src/manage.py runserver 0.0.0.0:8000
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user