Settings

Papermerge loads its settings from a configurations file. At first it tries to read following files:

  1. /etc/papermerge.conf.py
  2. papermerge.conf.py - from current project directory

If neither of above files exists it will check environment variable PAPERMERGE_CONFIG_FILE. In case environment variable PAPERMERGE_CONFIG_FILE points to an existing file - it will try to read its configurations from there.

If all above attempts fail, Papermerge will use default configurations values and issue you a warning. If you want to get rid of warning message, just create an empty configuration file papermerge.conf.py in project root directory (right next to papermerge.conf.py.example) or in location /etc/papermerge.conf.py.

Configuration file uses python syntax.

Some of the most used configurations which you might be interest in:

Paths and Folders

DB_DIR

  • /path/to/papermerge/sqlite/db/

Defines location where db.sqlite3 will be saved. By default uses project’s local directory.

Example:

DB_DIR = "/opt/papermerge/db/"

MEDIA_DIR

  • /path/to/media/

Defines directory where all uploaded documents will be stored.

By default uses a folder named media in project’s local directory.

STATIC_DIR

  • /path/to/collected/static/assets/

Location where all static assets of the project Papermerge project (javascript files, css files) will be copied by ./manage collectstatic command.

By default uses a folder named static in project’s local directory.

Example:

STATIC_DIR = "/opt/papermerge/static/"

Document Importer

Importer is a command line utility, which you can invoke with ./manage.py importer, used to import all documents from local directory.

IMPORTER_DIR

  • /path/where/documents/will/be/imported/from/

Location on local file system where Papermerge will try to import documents from.

IMPORTER_DIR = “/opt/papermerge/import/”

OCR

OCR_LANGUAGES

Addinational languages for text OCR. A dictionary where key is ISO 639-2/T code and value human text name for language

Example:

OCR_LANGUAGES = {
    'heb': 'hebrew',
    'jpn': 'japanese'
}

Note that both hebrew and japanes language data for tesseract must be installed. You can check Tesseract’s available languages with following command:

$ tesseract --list-langs

Default value for OCR_LANGUAGES uses following value:

OCR_LANGUAGES = {
    "deu": "Deutsch",  # German language
    "eng": "English",
  }

OCR_DEFAULT_LANGUAGE

By default Papermerge will use language specified with this option to perform OCR. Change this value for language used by majority of your documents.

Example:

OCR_DEFAULT_LANGUAGE = “spa”

Default value is “deu” (German language).

OCR_BINARY

Full path to tesseract binary/executable file. Default value is:

OCR_BINARY = "/usr/bin/tesseract"

Database

By default, Papermerge uses SQLite3 database (which is a file located in DB_DIR). Alternatively you can use PostgreSQL database. Following are options for PostgreSQL database connections.

DBUSER

DB user used for PostgreSQL database connection. If specified will automatically ‘switch’ from sqlite3 to PostgreSQL database.

Example:

DBUSER = “john”

DBNAME

PostgreSQL database name. Default value is papermerge.

DBHOST

PostgreSQL database host. Default value is localhost.

DBPORT

PostgreSQL database port. Port must be specified as integer number. No string quotes.

Example:

DBPORT = 5432

Default value is 5432.

DBPASS

Password for connecting to PostgreSQL database Default value is empty string.

EMail

You can import documents directly from email/IMAP account.

IMPORT_MAIL_HOST

IMAP Server host.

IMPORT_MAIL_USER

Email account/IMAP user.

IMPORT_MAIL_PASS

Email account/IMAP password

IMPORT_MAIL_INBOX

IMAP folder to read email from. Default value for this settings is INBOX.

IMPORT_MAIL_SECRET

Any email sent to the target account that does not contain this text will be ignored.