This project is a double-entry bookkeeping application for Django. It has been tested with Django release 2.0.
In order to use this application in your Django project, you need to do the following:
-
Install django-mptt.
-
Download this application and extract the
django-financial-accounting/accounting
directory into your project's base directory or into any location included in your Python module search path. -
Include
mptt
andaccounting
in theINSTALLED_APPS
list in your project'ssettings.py
. -
Include
accounting.urls
in theurlpatterns
list in your project'surls.py
, for example as follows:path('accounting/', include('accounting.urls'))
-
Run
./manage.py migrate
to update the database schema. -
If your organization's fiscal year differs from the calendar year, create an appropriate object for the current fiscal year, defining the start and end dates.
-
Create suitable journals and the chart of accounts e.g. by
- using the Django admin application, or
- extracting
sample-fixtures.yaml
from the package downloaded in step 2, installing PyYAML, and running./manage.py loaddata sample-fixtures.yaml
.
After these steps, you are ready to start entering transactions to the ledger. This can be done from the admin application or programmatically, e.g. as follows:
from accounting.models import *
txn = Transaction.objects.create(
journal=Journal.objects.get(code='C'),
description='Share issue'
)
txn.transactionitem_set.create(
account=Account.objects.get(code='1100'),
amount=-10000
)
txn.transactionitem_set.create(
account=Account.objects.get(code='3100'),
amount=10000
)
txn.commit()