Skip to main content

django ledger logo

Django Ledger

A Double Entry Accounting Engine for Django

Django Ledger is a powerful, high-performance financial management and double-entry accounting engine built on top of the Django Web Framework. It provides a robust, developer-friendly API and modular architecture 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

  • Double-Entry Accounting Engine: Strict balancing and transactional integrity.
  • Hierarchical Chart of Accounts: Flexible, multi-level account organization.
  • Financial Statements: Automated Income Statement, Balance Sheet, and Cash Flow Statement generation.
  • Commercial Documents: Purchase Orders, Sales Orders, Bills, and Invoices.
  • Financial Ratios & Analytics: Built-in calculation of key financial metrics.
  • Multi-Tenancy Support: Robust entity and organizational isolation.
  • Ledgers, Journal Entries & Transactions: Comprehensive general ledger management.
  • Banking & Imports: OFX & QFX file import capabilities.
  • Closing Entries & Inventory: Fiscal year-end closing and inventory management with Units of Measure.
  • Django Admin Integration: Seamless management and built-in Entity Management UI.

📦 Installation & Quick Start

Django Ledger is a Django application. You should have a working Django project before integrating Django Ledger.

1. Add to INSTALLED_APPS

Add 'django_ledger' to your project's INSTALLED_APPS in settings.py:

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

2. Configure Context Preprocessor

Add the Django Ledger context preprocessor to your templates configuration:

TEMPLATES = [
    {
        'OPTIONS': {
            'context_processors': [
                '...',
                'django_ledger.context.django_ledger_context',
            ],
        },
    },
]

3. Configure URL Routing

Include Django Ledger URLs in your project's root urls.py:

from django.urls import include, path

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

4. Run Database Migrations

Apply database migrations:

python manage.py migrate

5. Run Your Project

python manage.py runserver

Navigate to http://127.0.0.1:8000/ledger and log in using your superuser credentials.


⚙️ 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 continue using deprecated features during your migration, set DJANGO_LEDGER_USE_DEPRECATED_BEHAVIOR = True in your Django settings.

🛠️ Setting Up Django Ledger for Development (Using uv)

Django Ledger uses Astral uv for lightning-fast dependency management and virtual environment handling.

Prerequisites

Make sure you have Python (>= 3.11) and uv installed. If you don't have uv installed:

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or via pip
pip install uv

Development Setup Steps

  1. Clone the repository and navigate into the project directory:

    git clone https://github.com/arrobalytics/django-ledger.git
    cd django-ledger
    
  2. Create the virtual environment and sync dependencies:

    uv will automatically create a virtual environment and install all dependencies (including development tools) specified in pyproject.toml and locked in uv.lock:

    uv sync
    
  3. Activate the virtual environment (optional, or use uv run):

    source .venv/bin/activate
    
  4. Apply database migrations:

    uv run python manage.py migrate
    

    (Or simply python manage.py migrate if your virtual environment is activated)

  5. Create a superuser account:

    uv run python manage.py createsuperuser
    
  6. Run the development server:

    uv run python manage.py runserver
    

Database Dependency Groups

If you prefer using a database backend other than the default SQLite (such as PostgreSQL, MySQL, or MariaDB), uv provides dependency groups that you can sync:

  • PostgreSQL:

    uv sync --group postgresql
    

    Installs psycopg[pool,binary].

  • MySQL:

    uv sync --group mysql
    

    Installs mysqlclient.

  • MariaDB:

    uv sync --group mariadb
    

    Installs mariadb. You can also combine multiple dependency groups when syncing (e.g., uv sync --group dev --group postgresql).


📜 Licensing & Dual-Licensing Plan

Django Ledger is currently licensed under the GNU General Public License v3.0 (GPL-3.0).

  • 0.9.0 is a transition series: The 0.9.x releases are a transitional series in which Django Ledger prepares to offer dual licensing: GPL-3.0 for open-source use, and a commercial license. Starting with 1.0, Django Ledger will be a dual-licensed project.
  • Review of existing contributions: To enable this, existing third-party contributions will be reviewed and, where necessary, reimplemented by the project owner, so that the 1.0 release is fully controlled by the project owner or covered by the updated Contributor License Agreement (CLA).
  • Earlier versions: Previously released versions remain available under GPL-3.0.
  • New contributions: Contributions accepted from 0.9.0 onward are subject to the updated CLA, which permits dual licensing starting with 1.0.

We sincerely appreciate everyone who has contributed to Django Ledger. See Contribute.md for the full CLA text.


🤝 Getting Involved & Contributing

⚠️ CLA REQUIRED: By submitting a contribution (pull request, patch, documentation, tests, or other material), you agree to the updated Contributor License Agreement in Contribute.md. The CLA permits the project owner to license your contribution under GPL-3.0 and under commercial or proprietary terms. You retain your copyright. Please read it before opening a pull request.

Contributions are welcome. Please read Contribute.md before opening a pull request. The CLA applies to all contributions, including code, tests, documentation, and other project materials. Pull requests should target the dev branch.

  • Feature Requests & Bug Reports: Open an issue on GitHub.
  • Questions and implementation help: Contact Miguel Sanda or email msanda@arrobalytics.com.
  • Contribution Guidelines: See Contribute.md.

Who Should Contribute?

  • Python and Django developers.
  • Finance, accounting, and bookkeeping experts.
  • Anyone passionate about building robust financial engines.

📸 Screenshots

Entity Dashboard & Core Views

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

Financial Statements

balance_sheet_report income_statement_report cash_flow_statement_report

Metadata

Release files for django-ledger 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ledger 0.9.0
File Size Uploaded Provenance Actions
django_ledger-0.9.0.tar.gz 2.4 MB Without provenance Details for django_ledger-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-ledger 0.9.0
File Interpreter ABI Platform Actions
django_ledger-0.9.0-py3-none-any.whl Python 3 none any Details for django_ledger-0.9.0-py3-none-any.whl

Total release size: 4.9 MB

Release files / django_ledger-0.9.0.tar.gz

Download URL django_ledger-0.9.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
44cd6e8e78879d28c66ce21a3f2796b75a03a8bbc0f31dc1ffbd8788e49d6077
BLAKE2b-256 checksum
How to use checksums
e6bf2b4f9317bfd553a2aa71431c15cda696ad99155a9a150b21cc6a83928bbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / django_ledger-0.9.0-py3-none-any.whl

Download URL django_ledger-0.9.0-py3-none-any.whl
Size 2.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4bf46c74507908c79ea6d9fae7cb74447b9941b7a7209fa4da6d84db1c2bbb81
BLAKE2b-256 checksum
How to use checksums
84e94f0b3815cfa4e9face4089eff89b67b784c2f01c942d1f1a4cd501a150c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for django-ledger 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page