mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-10 00:35:30 +01:00
Add ability to provide the configuration file path using an env variable
This commit is contained in:
parent
d6e6f49c15
commit
4269074944
2 changed files with 9 additions and 8 deletions
|
|
@ -17,7 +17,10 @@ from django.utils.translation import gettext_lazy as _
|
|||
from dotenv import load_dotenv
|
||||
|
||||
# Tap paperless.conf if it's available
|
||||
if os.path.exists("../paperless.conf"):
|
||||
configuration_path = os.getenv("PAPERLESS_CONFIGURATION_PATH")
|
||||
if configuration_path and os.path.exists(configuration_path):
|
||||
load_dotenv(configuration_path)
|
||||
elif os.path.exists("../paperless.conf"):
|
||||
load_dotenv("../paperless.conf")
|
||||
elif os.path.exists("/etc/paperless.conf"):
|
||||
load_dotenv("/etc/paperless.conf")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue