Django project for writing letters with LaTeX
  • Python 82.5%
  • HTML 15.8%
  • CSS 0.7%
  • TeX 0.7%
  • JavaScript 0.3%
Find a file
Wolfgang Hammes 23dd5d6c19 HTMXified views
Changed widgets für LaTeX template-editor and the fields ps, encl and cc
2026-04-18 16:42:51 +02:00
.zed Some minor changes 2025-12-13 00:26:05 +01:00
accounts Some minor changes 2025-08-13 16:04:31 +02:00
authors HTMXified views 2026-04-18 16:42:51 +02:00
letters HTMXified views 2026-04-18 16:42:51 +02:00
locale HTMXified views 2026-04-18 16:42:51 +02:00
receivers HTMXified views 2026-04-18 16:42:51 +02:00
static HTMXified views 2026-04-18 16:42:51 +02:00
templates HTMXified views 2026-04-18 16:42:51 +02:00
texplates HTMXified views 2026-04-18 16:42:51 +02:00
wmletters HTMXified views 2026-04-18 16:42:51 +02:00
.dockerignore Corrected tests for authors and texplates. 2026-02-14 17:48:27 +01:00
.editorconfig Some minor changes 2025-08-13 16:04:31 +02:00
.gitignore Corrected tests for authors and texplates. 2026-02-14 17:48:27 +01:00
.pre-commit-config.yaml Some minor changes 2025-08-13 16:04:31 +02:00
.python-version Some minor changes 2025-08-13 16:04:31 +02:00
741b09d0-dd9b-43d0-b07d-779f6e601cfb.tex Changed text editor vom django-prose to django-martor and the contents 2026-03-20 18:57:44 +01:00
=2025.1.2 Some minor changes 2025-08-13 16:04:31 +02:00
LICENSE Some minor changes 2025-08-13 16:04:31 +02:00
manage.py First commit on new server 2025-05-11 13:38:24 +02:00
pyproject.toml HTMXified views 2026-04-18 16:42:51 +02:00
pytest.ini Some minor changes 2025-08-13 16:04:31 +02:00
README.md Some minor changes 2025-08-13 16:04:31 +02:00
todo.md changes in settings.py and pyproj.toml for later production 2026-02-08 16:51:13 +01:00
uv.lock HTMXified views 2026-04-18 16:42:51 +02:00

wmletters

A django system for creating din-letters.

The content for the letters is stored in tables for authors, receivers, templates and letters. The app renders the context to a LaTeX file, which is compiled with pdflatex. The app returns the created PDF file.

LaTeX, Pandoc and ImageMagick must be installed in the system for generating the LaTeX file, compiling it to the pdf format and create thumbnails. As database system Postgresql must be installed and there must be created a user for wmletters. If you create a database, user and password for test purposes as wmletters you don't need to edit of the project settings.

The software is in alpha state and you should not be used it in production. I hope, I soon finish the most of testing and translation and create a beta version.

I have used uv to create the pyproject.toml file. For installing uv look at https://docs.astral.sh/uv/getting-started/installation/

First create and start a virtual environment:

uv venv
source .venv/bin/activate

After this the dependencies for python must be installed with:

uv sync

You have to create a .env file in this directory for the following values:

DJANGO_SECRET_KEY=a real secret key
DJANGO_DEBUG=TRUE #for now TRUE
DB_NAME="wmletters"
DB_USER="wmletters"
DB_PASSWORD="wmletters"
DB_HOST=name of the host or docker container
DB_PORT=5432 #for postgresq
LANGUAGE_CODE="de" # or another language code. Full translation so far: de and little parts en
TIME_ZONE="Europe/Berlin" #  or wherever yoe live

To get a real secret key do the following in the python console:

from django.core.management.utils import
get_random_secret_key

Copy the secret key to the .env file. If the secret key contains a = character use quotation marks.

After this you must install the database tables and create a superuser for admin purposes.

uv run manage.py migrate
uv run manage.py createsuperuser

For localization start django-admin compilemessages.

For testing wmletters enter:

uv run manage.py runserver

Now you can call wmletters in the webbrowser with localhost:8000.

To create a new user call localhost:8000/admin.

You need to input one or more authors and receivers and a template. You can use the content of template-sample.txt for rendering. Create a template and copy the text to "LaTeX-Vorlage"