Templated-docs is a Django package that allows you to generate documents,including texts, spreadsheets and presentations, from templates. It utilisesLibreOffice as an underlying conversion document mechanism.
Features¶
- Generate any LibreOffice-supported document from within Django.
- Use Django template language inside office documents.
- Create custom generation management commands to integrate with other systems.
Installation¶

To install templated-docs:
You should consider installing it as mentioned in @nohillside's answer, by dragging to copy the LibreOffice.app into the /Applications directory. Alternatively, you can also install the app using Homebrew. If you already use Homebrew, you can simply run the following command-line in Terminal.app to install the app: brew cask install libreoffice. Brew cask install docker brew tap vangie/formula brew install fun Windows and Linux users must read this article to successfully install these tools. After the installation, first run the fun config command to initialize the configuration.
- Make sure you have LibreOffice >= 4.3.0 installed on the same machine
- Install a package with
pipinstalltemplated-docs
- Add
templated_docs
toINSTALLED_APPS
If you are using cpython you may need the libffi
development package inorder to compile this module’s dependencies.

- Ubuntu:
apt-getinstalllibffi-dev
- MacOS:
brewinstalllibffi

Brew Install Libreoffice Windows 10
Usage¶
Install Libreoffice Windows 10
To generate a document from a template sample.odt
you can write a viewlike this:
templated_docs.fill_template(template_name,context,output_format='odt')
- Fill a template
template_name
using acontext
dictionary as a context, optionally converting it to theoutput_format
. Returns a filename of a generated file.

More information¶
Brew Install Libreoffice-dev
- Working with document templates
- Useful template tags
