django-ledger is a free, open source finance & accounting project written in Python and released under GPL-3.0. It has 1,385 GitHub stars, 323 forks and 10 open issues, and was last pushed 14 days ago. On this registry it ranks #22 of 34 tracked projects in Finance & Accounting, with 5 head-to-head comparisons available. It gained 2 stars over the last 3 tracked days.

What is django-ledger?

What it is

Django Ledger is an open-source double-entry accounting system and financial analysis engine built on the Django Web Framework. It is a Python application, distributed under the GPL-3.0 license, and it is designed to be embedded in Django projects that need financial records, ledgers, and reporting.

The project addresses the problem of implementing core bookkeeping and financial reporting logic inside a custom application. It provides a high-level API for accounting tasks, including chart of accounts management, journal entries, transactions, financial statements, and financial ratio calculations.

Key capabilities

  • It supports double-entry accounting through ledgers, journal entries, and transactions.
  • It provides a hierarchical Chart of Accounts for organized account categories and subaccounts.
  • It generates Income Statement, Balance Sheet, and Cash Flow statements, and it calculates financial ratios.
  • It includes Purchase Orders, Sales Orders, Bills, and Invoices.
  • It supports OFX and QFX import, closing entries, inventory management, and unit of measures.
  • It offers multi-tenancy, Django Admin integration, and a built-in Entity Management UI.

Who uses it and how

  • Django developers add it to existing projects by installing it as a Django application, running migrations, and including its URL namespace.
  • Teams building financially driven applications use it for ledgers, journal entries, bills, invoices, purchase orders, and sales orders.
  • Multi-tenant applications can use its multi-tenancy support to separate accounting records across entities or customer contexts within one deployment.
  • Users who track bank activity can import OFX and QFX files, then use closing entries and statements for reporting.

Getting started

The README describes installation as a Django application: add django_ledger to INSTALLED_APPS, configure the django_ledger.context.django_ledger_context context processor, run python manage.py migrate, include django_ledger.urls, and run python manage.py runserver. The typical local workflow uses Django superuser credentials to access the ledger views.

When to use it — and when not to

Django Ledger is suitable when a Django application needs an embedded accounting engine with double-entry records, statements, ratios, and business documents, but it is not presented as a hosted accounting service. Self-hosters must operate the surrounding Django project, database migrations, URL routing, and any upgrade path, and the README notes that deprecated behavior is disabled by default starting in version v0.8.0. The facts do not list paid products it replaces, nor do they mention storage or SMTP requirements.

project readme (upstream, from github) — read inline

django ledger logo

Django Ledger

A Double Entry Accounting Engine for Django

Django Ledger is a powerful financial management system built on the Django Web Framework. It offers a simplified API for handling complex accounting tasks in financially driven applications.

Created and developed by Miguel Sanda.

FREE Get Started Guide | Join our Discord | Documentation | QuickStart Notebook

Key Features

  • High-level API
  • Double entry accounting
  • Hierarchical Chart of Accounts
  • Financial statements (Income Statement, Balance Sheet, Cash Flow)
  • Purchase Orders, Sales Orders, Bills, and Invoices
  • Financial ratio calculations
  • Multi-tenancy support
  • Ledgers, Journal Entries & Transactions
  • OFX & QFX file import
  • Closing Entries
  • Inventory management
  • Unit of Measures
  • Bank account information
  • Django Admin integration
  • Built-in Entity Management UI

Getting Involved

All pull requests are welcome, as long as they address bugfixes, enhancements, new ideas, or add value to the project in any shape or form.

Please refrain from submitting pull requests that focus solely on code linting, auto-generated code, refactoring, or similar cosmetic non-value add changes.

Who Should Contribute?

We're looking for contributors with:

  • Python and Django programming skills
  • Finance and accounting expertise
  • Interest in developing a robust accounting engine API

If you have relevant experience, especially in accounting, we welcome your pull requests or direct contact.

Installation

Django Ledger is a Django application. If you haven't, you need working knowledge of Django and a working Django project before you can use Django Ledger. A good place to start is here.

Make sure you refer to the django version you are using.

The easiest way to start is to use the zero-config Django Ledger starter template. See details here. Otherwise, you may create your project from scratch.

Adding Django Ledger to an existing project.

Add django_ledger to INSTALLED_APPS in you new Django Project.

INSTALLED_APPS = [
    ...,
    'django_ledger',
    ...,
]

Add Django Ledger Context Preprocessor

TEMPLATES = [
    {
        'OPTIONS': {
            'context_processors': [
                '...',
                'django_ledger.context.django_ledger_context'  # Add this line to a context_processors list..
            ],
        },
    },
]

Perform database migrations:

python manage.py migrate
  • Add URLs to your project's urls.py:
from django.urls import include, path

urlpatterns = [
    ...,
    path('ledger/', include('django_ledger.urls', namespace='django_ledger')),
    ...,
]

Run your project:

python manage.py runserver
  • Navigate to Django Ledger root view assigned in your project urlpatterns setting ( typically http://127.0.0.1:8000/ledger if you followed this installation guide).
  • Use your superuser credentials to login.

Deprecated behavior setting (v0.8.0+)

Starting with version v0.8.0, Django Ledger introduces the DJANGO_LEDGER_USE_DEPRECATED_BEHAVIOR setting to control access to deprecated features and legacy behaviors.

  • Default: False (deprecated features are disabled by default)
  • To temporarily keep using deprecated features while you transition, set this to True in your Django settings.

Setting Up Django Ledger for Development

Django Ledger comes with a basic development environment already configured under dev_env/ folder not to be used for production environments. If you want to contribute to the project perform the following steps:

  1. Navigate to your projects directory.
  2. Clone the repo from github and CD into project.
git clone https://github.com/arrobalytics/django-ledger.git && cd django-ledger
  1. Install PipEnv, if not already installed:
pip install -U pipenv
  1. Create virtual environment.
pipenv install

If using a specific version of Python you may specify the path.

pipenv install --python PATH_TO_INTERPRETER
  1. Activate environment.
pipenv shell
  1. Apply migrations.
python manage.py migrate
  1. Create a Development Django user.
python manage.py createsuperuser
  1. Run development server.
python manage.py runserver

How To Set Up Django Ledger for Development using Docker

  1. Navigate to your projects directory.

  2. Give executable permissions to entrypoint.sh

sudo chmod +x entrypoint.sh
  1. Add host '0.0.0.0' into ALLOWED_HOSTS in settings.py.

  2. Build the image and run the container.

docker compose up --build
  1. Add Django Superuser by running command in seprate terminal
docker ps

Select container id of running container and execute following command

docker exec -it containerId /bin/sh
python manage.py createsuperuser
  1. Navigate to http://0.0.0.0:8000/ on browser.

Run Test Suite

After setting up your development environment you may run tests.

python manage.py test django_ledger

Screenshots

django ledger entity dashboard django ledger balance sheet django ledger income statement django ledger bill django ledger invoice

Financial Statements Screenshots

balance_sheet_report income_statement_report cash_flow_statement_report

Frequently asked questions

Is django-ledger free to use?

django-ledger is open source under the GPL-3.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does django-ledger do?

Django Ledger is a double entry accounting system and financial analysis engine built on the Django Web Framework.

What is django-ledger written in?

django-ledger is primarily written in Python. Its source is publicly available at https://github.com/arrobalytics/django-ledger, and it has 1,385 GitHub stars.