Commit 6d282e03 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

check cli dependencies at startup

parent a9e3a2cf
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
from pathlib import Path
import os
import tempfile
from shutil import which
import sys

for tool in [
    "vips",
    "convert",
    "exiftool",
    "pdftoppm",
    "pdftotext",
    "tesseract",
]:
    if not Path(which(tool) or "/does/not/exist").exists():
        sys.exit(f"Couldn't find tool {tool}, please read installation instructions.")

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
BASE_DIR = Path(__file__).resolve().parent.parent