In this installation method you use a special papermerge command
to generate a bunch of configuration files in
folder. Then only with one single command:
systemctl --user start papermerge
you start a full fledged staging environment with nginx, gunicorn, one worker and recurring commands
running as services on a single machine. I really love this method and I use in my local development
environment. This method relies on systemd and its
You will need to install os specific packages first.
Make sure that your machine has both
nginx -V systemd --version
Clone main papermerge project:
git clone --depth 1 --branch v1.3.0 https://github.com/ciur/papermerge papermerge-proj
Create python’s virtual environment .env:
cd papermerge-proj python3 -m venv .venv
Activate python’s virtual environment:
Install required python packages (now you are in papermerge-proj directory):
# while in <papermerge-proj> folder pip install -r requirements.txt
Rename file config/settings/development.example.py to config/settings/development.py. This file is default for DJANGO_SETTINGS_MODULE and it is included in .gitignore.
In project root directory create
papermerge.conf.py and add there MEDIA_DIR for example.
In case you leave papermerge.conf.py empty - default values will be used.
Then, as in any django based project, run migrations and create super user:
cd <papermerge-proj> ./manage.py migrate ./manage.py collectstatic ./manage.py createsuperuser
Run startetc command:
Just out of curiousity, have a look
<papermerge-proj>/run at folder generated by
<papermerge-proj> should have following structure:
run ├── etc │ ├── gunicorn.conf.py │ ├── nginx.conf │ ├── papermerge.env │ └── systemd │ ├── papermerge.service │ ├── papermerge.target │ ├── mg_nginx.service │ ├── worker.service ├── log └── tmp
Systemd can be used to manage user services. For that –user flag is used.
User services must be referenced in
~/.config/systemd/user if you don’t have it. Then reference (create symbolic links)
<papermerge-proj>/run/etc/systemd/ units in
cd ~/.config/systemd/user ln -s <papermerge-proj>/run/etc/systemd/* .
Path <papermerge-proj>/run/etc/systemd/* must be absolute.
systemctl --user start papermerge.target