mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-24 22:39:02 -06:00
Still support conf
This commit is contained in:
@@ -6,12 +6,25 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
DEBUG = os.getenv("PAPERLESS_DEBUG", "false").lower() == "true"
|
DEBUG = os.getenv("PAPERLESS_DEBUG", "false").lower() == "true"
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
|
# Tap paperless.conf if it's available
|
||||||
|
for path in [
|
||||||
|
os.getenv("PAPERLESS_CONFIGURATION_PATH"),
|
||||||
|
"../paperless.conf",
|
||||||
|
"/etc/paperless.conf",
|
||||||
|
"/usr/local/etc/paperless.conf",
|
||||||
|
]:
|
||||||
|
if path and Path(path).exists():
|
||||||
|
load_dotenv(path)
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def __get_path(
|
def __get_path(
|
||||||
key: str,
|
key: str,
|
||||||
|
|||||||
Reference in New Issue
Block a user