Deploy Your App: Announcing the Talk Python in Production book.

Django Ledger: Accounting with Python

Episode #502, published Mon, Apr 21, 2025, recorded Tue, Apr 8, 2025

Do you or your company need accounting software? Well, there are plenty of SaaS products out there that you can give your data to. but maybe you also really like Django and would rather have a foundation to build your own accounting system exactly as you need for your company or your product. On this episode, we're diving into Django Ledger, created by Miguel Sanda, which can do just that.

Watch this episode on YouTube
Play on YouTube
Watch the live stream version

Episode Deep Dive

Guest Introduction and Background

Miguel Sanda is the creator of the Django Ledger project and a seasoned Python developer with a unique mix of business, data science, and finance experience. He began his career working in the finance domain within the nuclear construction sector, later moving to data science at a major utility company. His academic background includes engineering and business, culminating in the founding of Edma Group with his wife, where he focuses on accounting and financial planning for small businesses. Miguel's deep knowledge of both the Python ecosystem and accounting practices led him to build Django Ledger as an open-source, Django-based framework for double-entry accounting.

What to Know If You're New to Python

  • A basic understanding of the Django web framework will help you follow references to models, views, and how Django apps are structured.
  • Being familiar with object-oriented concepts is valuable for seeing how Django Ledger models represent entities and transactions.
  • A little exposure to the notion of double-entry accounting (credits and debits) can put many of the topics into better context.
  • If you want a structured place to begin your Python journey, you can later explore Python for Absolute Beginners.

Key Points and Takeaways

  1. The Motivation Behind Django Ledger Django Ledger grew out of a personal need to maintain books for multiple small businesses using open-source Python tech. Its foundation is a reliable, double-entry accounting engine built on top of Django's ORM. By making this framework freely available, Miguel has enabled teams to customize and integrate accounting directly into their Python apps.
  2. Django Ledger as Both Library and Application It can function as a standalone bookkeeping tool with a basic UI or as a "financial framework" within a larger Django-based system. Developers can import Django Ledger as a library, extend its models, and integrate its double-entry logic into their existing code. There's also a built-in interface to manage day-to-day accounting tasks and generate real-time financial statements.
  3. Fundamental Design: Double-Entry Accounting Django Ledger relies on a traditional credit and debit system, tracing back centuries to classic double-entry bookkeeping. All transactions reference accounts in a structured way to ensure the books always remain balanced. This approach is crucial for generating reliable financial reports such as balance sheets and income statements at any moment.
  4. Entity and Ledger Models The project's data model uses an Entity or Company concept at the top, then organizes the more granular financial details into separate ledgers. Each ledger can represent a department, product line, or even a single asset like a car or tractor. By aggregating ledger-level financials, users can roll up data to see the bigger organizational picture.
    • Links and Tools:
      • SQLite (common for development)
      • MongoDB (possible with Django if using the new official MongoDB backend)
  5. Extensibility with Plugins While Django Ledger is not an automation framework, it's designed to be extended with Django apps that act like plugins. For example, someone could build a reconciliation plugin or directly integrate with Stripe webhooks to automate import of sales transactions. This modular approach keeps Django Ledger's core unopinionated yet powerful.
  6. Real-Time Financial Insights Because Django Ledger enforces correct accounting entries as they happen, up-to-date financial statements can be generated on demand. This is particularly valuable to startups or service-based businesses needing real-time revenue and expense monitoring rather than periodic end-of-month updates.
  7. Transaction Staging and Reconciliation A dedicated staging area lets you import or queue transactions, such as from a bank statement, before committing them to the main ledger. This allows accountants or finance teams to reconcile, categorize, and confirm the transactions match the organization's records, reducing errors and unauthorized entries.
    • Potential Plugins:
      • Bank reconciliation modules
      • Automated import from external APIs
  8. Support for Different Databases Django Ledger works with any DB engine that Django supports, including PostgreSQL, MySQL, and SQLite. While it's feasible to run it on something like SQLite for small projects or testing, a database like Postgres is ideal for production to handle concurrency and reliability.
  9. Security and Multi-Tenancy Django Ledger incorporates Django's user and permission model but also adds its own structure for entity managers and owners. This extra layer ensures that only authorized individuals see the relevant set of books or can post transactions. Such multi-tenant controls let one Django app support many clients or departments securely.
  10. The GPL v3 License Choice Miguel chose GPL v3 to ensure that if anyone distributes modifications or builds upon Django Ledger, those changes remain open source. It doesn't prohibit companies from using the software internally for bookkeeping but preserves transparency when the code itself is released. This aligns with the project's goal of open collaboration.

Interesting Quotes and Stories

"Django Ledger saves a lot of time when it comes to developing a financially-driven application that developers can use, and accountants can work with, right away." -- Miguel

"One of the benefits of Django Ledger is being intentional about financial transactions from the moment they're created." -- Miguel

"If you had a team of developers and a team of accountants, they can both dive in right away using something like Django Ledger because there's a common interface for both worlds." -- Miguel

Key Definitions and Terms

  • Double-Entry Accounting: A system where every financial transaction affects at least two accounts, one with a debit and one with a credit, ensuring the books remain balanced.
  • Ledger: In Django Ledger, it represents a self-contained unit of accounting (e.g., a product line, a specific asset, or a department).
  • Blueprints: Django Ledger's mechanism for defining custom financial actions or transaction templates, letting you dispatch transactions programmatically.
  • Financial Middleware / Digest Process: A step that aggregates individual transactions into higher-level statements, applying accounting rules so you can generate consistent reports.
  • Multi-Tenant: The design where multiple users, clients, or companies can operate under a single application instance while keeping their data and permissions separate.

Learning Resources

Overall Takeaway

Django Ledger offers a powerful, customizable pathway for anyone wanting to integrate trustworthy accounting features into Python web applications. By staying open source, leveraging Django's strong ecosystem, and respecting core accounting principles, it invites both developers and finance professionals to collaborate. With its flexible structure, real-time reporting capabilities, and multi-tenant security model, Django Ledger paves the way for modern bookkeeping and financial innovation all within the Python ecosystem.

Miguel Sanda on Twitter: @elarroba
Miguel on Mastodon: @elarroba@fosstodon.org
Miguel on GitHub: github.com

Django Ledger on Github: github.com
Django Ledger Discord: discord.gg

Get Started with Django MongoDB Backend: mongodb.com
Wagtail CMS: wagtail.org
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm

--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy

Episode Transcript

Collapse transcript

00:00 Do you or your company need accounting software?

00:02 Well, there are plenty of SaaS products out there that you can give your data to, but maybe you also really like Django and would rather have a foundation to build your own accounting system exactly as your company or your product needs.

00:14 On this episode, we're diving into Django Ledger, created by Miguel Sanda, which can do just that.

00:20 This is Talk Python to Me, episode 502, recorded March 6, 2025.

00:26 Are you ready for your host, please?

00:28 You're listening to Michael Kennedy on Talk Python to Me.

00:32 Live from Portland, Oregon, and this segment was made with Python.

00:38 Welcome to Talk Python to Me, a weekly podcast on Python.

00:41 This is your host, Michael Kennedy.

00:43 Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both accounts over at fosstodon.org, and keep up with the show and listen to over nine years of episodes at talkpython.fm.

00:57 If you want to be part of our live episodes, you can find the live streams over on YouTube.

01:01 Subscribe to our YouTube channel over at talkpython.fm/youtube and get notified about upcoming shows.

01:08 This episode is sponsored by Auth0.

01:11 Auth0 is an easy to implement, adaptable authentication and authorization platform.

01:15 Think easy user login, social sign-on, multi-factor authentication, and robust role-based access control.

01:22 With over 30 SDKs and quick starts, Auth0 scales with your product at every stage.

01:28 Get 25,000 monthly active users for free at talkpython.fm/Auth0.

01:34 Hey, Miguel. Welcome to Talk Python To Me.

01:37 Hey, thank you, Michael, for having me.

01:39 I'm excited to have you here.

01:40 I'm looking forward to talking about Django stuff.

01:44 Django is certainly one of the premier and one of the longest vibrant web frameworks from the Python community.

01:52 You've got a really interesting project that you've created here on Django Ledger.

01:56 So it's going to be a lot of fun to talk about it.

01:58 Yeah, absolutely.

01:59 Yeah, let's do it.

02:00 Yeah, let's do it.

02:01 Now, before we dive into accounting and all of those things, let's first talk about you, your background.

02:09 I know it's a little bit specialized.

02:11 And actually, I think a little bit of your history really is kind of a case study of things that I say, like really help people do lots with software and Python.

02:20 So yeah, let's dive into it.

02:21 Yeah.

02:22 No, absolutely. So yeah, absolutely. This is Miguel Sanda. I'm the lead developer and the creator of Django Ledger. I have been working on that project for quite some time now. It has been going through several different iterations and the evolution is quite interesting. But as far as my professional background, I have about nine years of experience in the finance sector, specifically in the nuclear construction sector here in the United States. That was my beginnings in the finance sector. After that experience, I became a data scientist. So, and I joined one of the largest utilities in the United States as a data scientist to work on power distribution and generation analytics and engineering stuff for quite some time. So, I got about eight years there.

03:13 And from an educational background, I have a background in engineering and business. So, So, yeah, I know it's such a crazy thing.

03:21 I always say, you know, I went back into programming just because I wanted to make my hobby my career.

03:28 And here I am.

03:30 So and about two years ago, me and my wife, we founded Edma Group, which is an accounting and financial planning firm.

03:37 It is focused on small business and real estate investors.

03:42 So we basically help them, you know, put together a plan for the business.

03:46 We take care of the bookkeeping, the accounting, and we work on all sort of financial-related stuff with them.

03:52 So, yeah, in a nutshell, that's what it is.

03:55 What a wild mix, huh?

03:56 Yeah.

03:57 I was going to ask you if it's stressful to work on accounting software, but then you mentioned nuclear.

04:05 Yes.

04:06 The consequences are way higher on nuclear than they are on accounting.

04:10 That's right, yeah.

04:11 So, yeah, I work on a lot of financials and stuff related to nuclear construction.

04:17 a lot of regulatory stuff there going on.

04:19 But yeah.

04:20 Oh, there's got to be.

04:21 Yeah.

04:22 There's got to be a crazy amount of regulation there.

04:24 Yeah.

04:25 Yeah.

04:26 Yeah.

04:26 It's interesting, you know, especially when it comes from financial reporting standpoint, a lot of the, you know, financial gymnastics that had to happen in order to properly report financials in that sector, you know, it had to do a lot with, you know, understanding the nuclear side of things.

04:46 and the energy generation side of thing and also the accounting and finance side of things.

04:51 So it was a very interesting experience there.

04:53 Yeah, I'm sure it was.

04:55 Let's talk about nuclear just for a second.

04:56 So are you bullish on nuclear?

05:00 Do you think nuclear has an important role to play here?

05:03 To me, it's such a contradiction of trade-offs.

05:08 On one hand, we have to get rid of pumping carbon into the atmosphere now.

05:13 You know what I mean?

05:14 And there's no better option than nuclear, like not even close.

05:18 On the other hand, at least the way nuclear is done in the United States today, so much of the history comes from let's build these power plants that also generate plutonium for our nuclear weapon program.

05:32 And so they didn't make tradeoffs necessarily that were safer or would store the waste in a better, less dangerous way.

05:39 It was more about like, well, let's get this cool, really reactive thing that

05:43 comes off.

05:44 And I know there's a ton of work with Thorium and other things to make it kind of take a different path.

05:49 Yeah.

05:49 Right.

05:49 But I don't know how far we've taken that path.

05:51 How do you feel about nuclear?

05:52 Are you for or against it?

05:56 It is a double-edged sword, you know.

05:58 I think nuclear, in principle, is a very clean source of energy if done properly, if done correctly, of course.

06:08 Obviously, the downside of that is, you know, you're dealing with something that could potentially be catastrophic if it's not controlled properly.

06:16 So, you know, working nuclear back in about 15 years ago, technology was very different.

06:25 So the new generation of plants were being built in China and the United States.

06:29 So they relied on a lot of many different mechanisms to kind of like control something like that.

06:38 Very different from the nuclear power plants that were built along, you know, about decades ago.

06:43 But I think from an energy source standpoint, it's very clean.

06:49 Obviously, it comes down to how well it is monitored and controlled to make sure that, you know, we don't end up being, you know, harming the environment or

07:00 human lives or anything like that.

07:02 So I live nearby my home.

07:04 There's four nuclear power plants.

07:05 So there's actually quite a few in the southeast. Yeah, that's right. So, you know, you have that five mile radius, 15 mile radius. And these are the power plants that were built back in back in the 70s or a long time ago. So, yeah, I mean, like I said, it's a double S store. There's no right or wrong answer to that. But I feel like it's very reliable. And from a power distribution standpoint, it is always a good base load to have because it's kind of like that permanent, you know, like capacity that you have.

07:35 there. And then you have other things like pickers and stuff like that, you know, that come into play when demand goes up.

07:42 Yeah.

07:42 Yeah. I'd be all for it as soon as we have fail safe instead of fail explosive sort of things, you know, like

07:49 salt reactors that like drain themselves rather than overheat and explode and so on. But

07:54 yeah, not that this is a nuclear show, but I think it's just, you know, you're so close to it and it's such an

07:59 interesting, we're at such a decision point.

08:02 Yeah, but I have to say the new generation, my understanding is it's much smaller, it's safer, it's more of a controlled environment.

08:10 So, you know, my understanding is that they're doing good research and good, you know, advancements in that area.

08:17 But it's, like I said, it's been a while since I've been in nuclear, so I can't speak to that.

08:21 Yeah, I feel like there's a lot of regulation, a lot of old perceptions that are going to keep regulation super hard for it.

08:27 But yeah, let's talk accounting.

08:30 Yeah, absolutely.

08:31 Let's talk accounting.

08:32 Switch years.

08:34 Yeah, for sure.

08:35 So for your project, I think maybe let's talk a little bit of just a tiny bit of the history of accounting, double entry accounting, these types of things.

08:45 All this stuff, this is not new technology in a sense.

08:49 It comes from 1494, some of these ideas here.

08:55 But people used to do it with paper.

08:56 And now you're building cool projects with Python and Django to do it.

09:01 Yeah.

09:02 So I guess what did you use?

09:04 It sounds like you've done a ton of financial stuff.

09:06 What did you use at different stages in your career that weren't this?

09:11 What was the history that led up to your experience to build this?

09:13 Well, yeah, absolutely.

09:15 So like I said, I started working in the accounting and finance sector.

09:19 But at some point, I started kind of like creating.

09:22 Me and my wife were also entrepreneurs.

09:24 So we started our own businesses.

09:26 And obviously, you know, when you're a data scientist and you know all this Python and I knew Django, I kind of wanted to start my own bookkeeping of my own businesses, you know, using Django.

09:37 Right. You know, I can do this thing on my own, you know.

09:41 So I started creating this project back in 2018, something like that.

09:46 The repo went live in 2020.

09:49 But it was my way of keeping my own books.

09:51 It was kind of like my journal.

09:53 I was just adding transactions to it, you know, looking at the back statement, keeping my own bookkeeping so I could do my own taxes and my own monitoring of my business.

10:02 So that's how it started. Right. And eventually it started growing and growing and growing.

10:08 And I added an interface and I created the Django views and things like that.

10:12 So and, you know, at some point I felt like it was mature enough to share it with the world.

10:18 So I posted it back and published it on GitHub back in 2020.

10:23 But it was very early stages.

10:24 You know, it was buggy.

10:26 It was by any means it wasn't ready for any production environment or anything like that.

10:31 But throughout the years, you know, I kind of dedicated some time to it until it grew to the point where, you know, it is today.

10:39 So and that is because, you know, I've dedicated, you know, a lot of time to it, a lot of research involved.

10:48 and yeah so it's been interesting so it's been quite a while it's not a small project by any means

10:56 no it's definitely not it's got a good mix of technology here got a decent number of contributors that's great a thousand get up stars so it's certainly got some momentum here that's fantastic are you using you said you're starting this you have started this independent firm to do bookkeeping and accounting for other companies Are you using this as part of it or is it still something you're using personally?

11:22 I use Django Ledger to, because there's different use cases of the software, right?

11:27 So it's not just bookkeeping for, you know, if you wanted to keep the books of a certain firm or a certain company, right?

11:36 The way I use it is I run simulations.

11:38 So basically what I do is, you know, if I have a client that needs some, we need to implement some sort of financial plan.

11:45 You know, I've had, you know, like what's called blueprints.

11:49 You know, in the software, you write something that is called blueprints that help you make, you know, like dispatch transactions and things like that.

11:57 So I use it to run simulations, basically, and present financial plans to small businesses and business owners and present them in a way that is obviously, you know, it's visually appealing and things like that.

12:12 But all the background is done in Django Ledger.

12:15 So that's one of the ways I use it, in addition to keeping the books of one of my businesses.

12:21 Nice.

12:21 Yeah, there's nothing like actually using it in production for real use cases that makes you realize something.

12:28 Well, maybe that's not perfect.

12:30 You're like, oh, no, that needs to change.

12:32 This isn't going to work, right?

12:33 You're really running into the real world quickly that way.

12:36 Yeah.

12:37 There are use cases for, you know, you could use Django Ledger, for instance, if you had a startup.

12:44 or you had something that requires you to keep the books updated, or if you wanted real-time analysis of how your business is going, Django Ledger is a good solution to that because you could, you know, one of the benefits of Django Ledger is to being intentional about financial transactions of your business, right?

13:06 So usually how it works is you have an application that has some sort of like a single entry database where you record transactions.

13:15 But those transactions, they do have a ripple effect, right?

13:18 They do have a ripple effect in the financial statements.

13:21 And usually a bookkeeper or an accountant needs to come in later and piece it all together, right, in order to produce financial statements or preparatory taxes or things like that.

13:32 But Django Ledger Bridges kind of like closes that gap.

13:36 It is intentional from the moment the transaction is created.

13:40 So you can always get financial statements pretty much on real time if you had a financially driven application that you'd like to use Django later for.

13:50 This portion of Talk Python to Me is brought to you by Auth0.

13:54 Do you struggle with authentication?

13:56 Sure, you can start with usernames and passwords.

13:58 But what about single sign-on, social auth, integration with AI agents?

14:03 It can quickly become a major time sink.

14:05 And rarely is authentication your core business.

14:09 It's just table stakes that you got to get right before you can move on to building your actual product.

14:14 That's why you should consider Auth0.

14:16 Auth0 is an easy to implement, adaptable authentication and authorization platform.

14:21 Think easy user logins, social sign-on, multi-factor authentication, and robust role-based access control.

14:28 With over 30 different SDKs and quick starts, Auth0 scales with your product at every stage.

14:36 Auth0 lets you implement secure authentication and authorization for your preferred deployment environment.

14:41 You can use all of your favorite tools and frameworks, whether it's Flask, Django, FastAPI, or something else, to manage user logins, roles, and permissions.

14:50 Leave authentication to Auth0 so that you can start focusing on the features your users will love.

14:55 Auth0's latest innovation, Auth4Gen AI, which is now available in developer preview.

15:00 secure your agentic apps, and integrate with the Gen.AI ecosystem using features like user authentication for AI agents, token vault, async authorization, and FGA for RAG. So if you're a Python developer or data scientist looking for an easy and powerful way to secure your applications, get started now with up to 25,000 monthly active users for free at talkpython.fm/auth zero.

15:26 That's talkpython.fm/auth zero. The link is in your podcast player's show notes.

15:30 Thank you to Auth0 for supporting the show.

15:33 Yeah, I don't know that I've actually given you a chance to properly introduce it.

15:37 You know, how would you tell, you know, what's the elevator pitch for Django Ledger?

15:42 Someone, what projects do you work on?

15:45 Yeah, so, I mean, Django Ledger is, it's a financial framework, what I would say.

15:50 It's a financial framework on top of other frameworks.

15:52 So what I would say Django Ledger is it leverages Django as a framework, you know, all the security, everything you want to leverage, everything Django is famous for.

16:05 But on top of that, Django Ledger is the financial framework on top of Django.

16:09 So what you do is basically you don't have to figure out, you don't have to reinvent the wheel when it comes to, you know, the double entry accounting system, right?

16:18 What you do is, you know, if you had a team of developers and you had a team of accountants or finance people, you know, they can work right off the bat, right away using something like Django Ledger because there is a common interface for that, for both of those worlds to interact, right?

16:36 So Django Ledger saves a lot of time when it comes to developing a financially driven application that developers can use, you know, from a software development standpoint, you know, from an application logic standpoint.

16:50 But at the same time, it also helps accountants keep the financial behavior updated, you know, and it's all based on Python functions.

16:59 So which is pretty simple.

17:00 Yeah, that's really neat.

17:01 So the name here is, or the subtitle is Object-Oriented Accounting Engine.

17:07 So is Django Ledger a finished application or is it a library that I plug into my application?

17:15 You know, is it ready to go out of the box or is it a framework to build my accounting engine?

17:21 Yeah, it can be both.

17:22 You can use it out of the box as a very basic replacement for commercially available software.

17:33 I don't want to mention any of those, but you could go online and find accounting software.

17:37 You'll find those.

17:39 I've used a couple over the years.

17:41 I could name them as well.

17:43 So the foundation is there.

17:45 You can go in there.

17:46 You can create transactions.

17:47 You can import your bank statements.

17:48 And so when I created Django Ledger, I wanted to provide some basic functionality from a UI standpoint so you can manage your finances.

17:57 But at the same time, you can use it as a library.

18:00 You can extend Django Ledger.

18:03 And to your point, it's object-oriented accounting engine because you can use the models inside Django Ledger to extend and adapt your business logic to the models.

18:14 So you can pretty much, you know, kind of like create your own little financial world.

18:19 Right.

18:20 So I'll give you an example.

18:21 So if you if you have if you're into real estate, for instance, you could kind of create take the ledger model, extend it and make it a rental property.

18:31 Or if you are in the, for instance, the farming business, you could create, you know, let's say, hey, this is my tractor.

18:38 Right.

18:38 Right, right. Or crops and commodities and all the details of commodity trading and pricing and all that, right?

18:45 That's right. So Django Ledger is unopinionated when it comes to that particular aspect of the finance and accounting sector.

18:54 But you can extend it. Like I said, you can extend it and incorporate that domain-specific knowledge into the models and use the blueprints to dispatch things.

19:04 you know.

19:05 Okay, interesting. So that sounds like if I'm creating a Django application and it's going to have a core financial or accounting component to it, bringing Django Ledger in could really make that work well, right?

19:18 That is correct, yes. That can certainly help you with that.

19:21 So how does that work? I guess, what are my options? Would I expose a subset of my application as effectively a styled Django Ledger sub-application, like you kind of can with the admin backend and stuff like that?

19:35 Or would it be maybe I write my own UI and then I just work with the models and some of the libraries that come with Django Ledger?

19:43 Yes.

19:44 So if you have an existing application, you can pull in Django Ledger and pretty much, you know, if you're using Django, you could either grab a Django model and kind of create a relationship with a ledger model or on an entity model, right?

19:58 and integrate it that way.

20:01 So if you have an existing application, you can bring it in.

20:05 Or you could use Django Ledger as the total foundation of your application.

20:11 You could write APIs, you could write all the things that you need to kind of integrate with other things.

20:16 But you have plenty of options when it comes to bringing Django Ledger into your existing project or starting from scratch.

20:25 Okay.

20:26 What if I'm not doing Django?

20:28 So there's, you know, what if I'm doing Flask, for example, but I still want to use it, right?

20:36 You know, out in the audience, I've got a question, is it safe to run with Django Ninja?

20:39 And more broadly, could I expose Django Ledger as basically an HTTP endpoint, HTTP service, and then just do that instead of directly working with the model, have my app do its accounting over an internal API effectively?

20:57 Yeah, absolutely. I think one option if you're not using Django as part of your stack is probably to create a microservice or, you know, or some sort of like a gRPC server or something like that, that you could expose a function, you know, and deploy the service separated from your main application and just dispatch these blueprints that way.

21:19 Right. So you could just go through an API endpoint, you know, or something like that that can help you integrate with existing applications, even if you're not using Python, you know, or anything like that.

21:32 You know, like gRPC is really language agnostic and I've done it.

21:37 I've used Django Ledger with gRPC services to kind of like integrate it with with other things.

21:41 Right. So so you have everything that Python has to offer from a you have it at your disposal.

21:51 Sure. Of course. Yeah. And I mean, just because my mind is in that place of like, well, other Python frameworks.

21:57 So, yeah, you could use it with anything. Right. Because as long as it talks REST or it talks GRPC or whatever you want to expose it as. Right.

22:05 That's right. Yep.

22:06 Cool. Is there an API built into Django Ledger that we could already use, or do we integrate, do we just say, like, we're going to add the behaviors we need on top of it?

22:16 Yeah, Quarkly has a very basic API, and it's really being used to populate some of the charts that are, you know, part of the UI right now.

22:28 I just know if you've got, like, maybe a JavaScript callback, it can get the data that way?

22:33 Yes, it has a very basic, again, it has the, not to get nerdy here, but it has an income statement call.

22:39 It has a, or a P&L balance sheet.

22:43 It has a very basic API where you can request that financial data and it's parametized.

22:50 So you can get it into your JavaScript world and kind of populate chart with, you know, with anything you want to use, like Chart.js or, you know, or if you're using any other stack.

22:59 So it does have some APIs built in, but it's not a full-blown API, you know, with, you know, like a gradual thing.

23:08 Yeah, yeah.

23:09 You know, honestly, that sounds good to me.

23:12 So often I'll see frameworks or I'll see things like this.

23:17 I'll say, well, it has a complete API.

23:20 And the complete API, what that means, especially with some of these, like, we'll add API features to your app.

23:29 It's just we'll let people query the database directly, right?

23:32 You know, like, oh, you can just hit this endpoint and that's that table.

23:36 And you put the query string as like the filter or whatever.

23:39 And just, I don't know, that's never, that's always felt like a cop out to me.

23:44 Because whoever's running the application or building and controlling the application should have some say of like, well, what are the actions you need to take here?

23:52 And this action actually involves three tables, not just one.

23:56 And it actually might also involve a transaction, right?

23:59 Which accounting is so often the most common example of why we need transactions and concurrency safety and all those things, right?

24:06 Yeah.

24:06 So having that greater control, like, you know, let's suppose we're back to our farmer, right?

24:12 Like record the sale of some commodity or something, right?

24:17 That might require multiple interactions.

24:20 And you don't want to depend upon somebody calling the right APIs against your sort of generic database as an endpoint thing, right?

24:27 That's right.

24:28 So one of the things that Django Ledger has is this concept of financial middleware.

24:35 So basically, there are separate stages.

24:39 When you make a call from Django Ledger into the database, you're not pulling the raw Django model out of the database, right?

24:47 The data is stored into separate different models.

24:50 One of them is a transaction model, which stores, you know, kind of like it's like your account, your account, your financial account and the money that gets allocated via credit or a debit.

25:01 But that is a very long form table.

25:04 Just pulling transactions out of that table is not going to give you the answer.

25:08 So basically, Django Ledger has different ledgers.

25:11 Number one is aggregating the data, you know, or pushing as much work as possible to the database layer to aggregate those transactions.

25:19 Right.

25:20 So let the do database do what it's supposed to do, right?

25:23 So it aggregates to pull the minimum amount of data into the Python memory.

25:29 And then there is another step, more steps there.

25:33 There's aggregation going on.

25:35 There's also accounting rules being applied.

25:37 There's a financial middleware that applies, you know, all sorts of things.

25:41 And then, which is called the digest process.

25:44 And then once you pull that out, you will get a Python object, which is an IOContext object.

25:51 And that has all the data you need, like already sorted out.

25:55 Everything is organized by account, everything.

25:58 And at that point, that is the object that you can use for if you're developing APIs or you're making a gRPC call or whatever.

26:06 So that's why, you know, in the context of Django Ledger, you don't go directly to the table because that is not efficient.

26:13 So Django Ledger is solving a lot of those problems for you because it's aggregating the data in a nice way so you can take it from there and integrate it into your application.

26:22 Yeah.

26:23 And that's exactly the kind of stuff I was thinking, right?

26:26 You lose a lot of the value of the application if you just go straight to the database.

26:32 That's right.

26:33 And honestly, what Django Ledger is doing is applying those accounting rules.

26:37 So you have kind of like a gap, let's call it gap compliant output, general accounting principle rules that are kind of like the best practices.

26:47 So from that point going forward, you can share it with the world pretty much.

26:51 Nice.

26:52 Okay.

26:52 So I guess back to the original question, Django Ninja would be fine to use?

26:57 Yeah.

26:58 Yeah.

26:59 Yeah.

27:00 Or Django REST framework, maybe?

27:02 Django REST framework, Django Ninja, you could use, I've used even GraphQL frameworks.

27:08 So if you can define your schema and you can do code first or schema first, whichever you prefer, I feel like the ones that are code first will give you that GraphQL schema right off the bat.

27:23 So you could use, I can't remember your name, but I think it's Ariadne or, there's two Django frameworks that are GraphQL.

27:32 So I've used both of them and there's plenty of them, but you can integrate any API.

27:38 gRPC, GraphQL, REST framework.

27:41 Message pack, you name it, right?

27:43 You can do whatever you want, right?

27:44 Whatever you want, pretty much.

27:46 Okay.

27:47 Is there a database backend limitation or is there a database backend that you recommend?

27:53 It sounds like the more you ask the database to do, the more that might restrict which databases will actually work.

27:59 It's not just straight CRUD, you know?

28:01 Yeah.

28:02 So I would say, since it's based on Django, so whatever database Django supports should be okay.

28:11 I have used PostgreSQL for most of my projects.

28:15 PostgreSQL works extremely well.

28:18 Even on development, you use SQLite, and it works extremely well as well.

28:24 So I would try to avoid small databases for kind of like bigger project with a higher volume of transactions.

28:34 But, you know, it would really depend on, you know, how busy your application is.

28:40 Yeah.

28:41 I imagine a lot of them probably are not too busy, but you never know, right?

28:45 It depends what it's doing, I suppose.

28:46 Yeah, it depends on the use case, right?

28:48 So let's just say that you have a very traditional use case where you have a startup and you're developing your own application and you kind of want to have some sort of like a financial back end to it.

29:01 I think in those particular cases, it shouldn't be an issue.

29:05 I mean, whatever database.

29:06 You could run that on whatever.

29:08 Because if you have a startup and you need to scale the recording of your purchases, you've got a good startup.

29:15 I mean, it's not going to be a startup for long if it's like we can't handle the amount of sales per second in terms of recording them, right?

29:22 Like, you know, good problem to have.

29:24 But it's not like scaling your front end where people are like, you know, AI-ing cat pictures.

29:32 That's right.

29:33 I think a volume of 1,000 transactions, 2,000 transactions per day, you know, it's still relatively small compared to, you know, if you're using something like IoT or where you have billions and billions of records.

29:44 So I think for most financial use cases, you should be fine in terms of the volume of transactions.

29:54 Yeah, I would imagine just something with a database that's got a good durability story, then you should be fine.

30:01 That's correct, yeah.

30:03 And certainly Postgres is incredibly well-known, incredibly well-respected.

30:07 You can get it as a service at so many, pretty much wherever you are, you can get Postgres as a service.

30:13 Yeah.

30:14 So one interesting idea that I have for the future of this project is see if I could integrate this with a distributed system.

30:22 You know, being a data scientist, I've worked a lot with Adub and Spark, you know, and things like that.

30:26 So I wonder if there's a possibility to, you know, if you're supporting, of course, more enterprise-y kind of like use cases to see if, you know, in order to have not a single point of failure, you know, if you could leverage, you know, distributed clusters, you know, or things like that.

30:43 But that's still, you know, experimental at this point.

30:47 Yeah.

30:48 How's it going?

30:48 Are you making it happen?

30:50 I have some ideas.

30:51 You know, I have a Hadoop cluster here at home.

30:53 So every now and then I just try to see if I could start developing some sort of like a Hadoop application that could support.

31:03 Because one of the things about Django Ledger is if you see the models, you have the entity model, the company model, then it goes down to the ledger model, then the journal entry, and then the transaction.

31:15 The ledger is a self-contained unit of accounting, right?

31:20 So the ledger itself is really a small piece of the company.

31:25 It's really a small piece.

31:26 The ledger could be like a car.

31:28 It could be like a tractor.

31:29 It could be even a cow, if you want.

31:34 So whenever this ledger model kind of like runs the financial statement, it's really a small piece of the puzzle.

31:42 But even that little ledger, it is like a small company.

31:47 So basically, the ledger can compute the financial information anywhere. You could use something like salary, you could use something like anything like that, and then bring all the ledgers together and aggregate them, and you will get to the same answer.

32:02 So even if you're reaching a point where the database becomes an issue, you know, as far as from the data volume standpoint, you can piecemeal the call and you can break it, chunk it down and then aggregate it in separate, let's just say separate servers and then bring it back together.

32:19 Yeah, that's a really cool idea. You know, I think, did Django just add some background task stuff? I know this thing I pulled up as an external library, but I feel like that's something that's come into Django recently.

32:33 Yeah, I think so. I haven't really deep dived into this. I use Celery.

32:38 I use Celery most of the time. You know, one of the things that I've included in Django Ledger is a very comprehensive kind of like list of signals that you could wire your application to. And if you had some sort of like a background task, you know, you could perform those things, you know, so you don't have to implement your own signals and things like that.

32:58 Oh yeah, that's nice. This portion of Talk By Thundering is also brought to you by Auth0. Earlier, I told you about how Auth0 can allow you to quickly get full-featured authentication built into your app so you can focus on building core elements. Now, let's talk AI. No, not using AI to integrate Auth0, though that probably worked pretty well. I want to tell you about Auth0's latest innovation, Auth4Gen AI, which is now available in developer preview.

33:26 You can enable AI agents to securely access tools, workflows, and data with fine-grained control in just a few lines of code.

33:35 Why might your agents need auth?

33:37 Well, here's a few reasons.

33:38 User authentication.

33:40 You can easily implement secure login experiences for AI agents from interactive chatbots to background workers.

33:46 You also get the token vault.

33:48 You can use secure standards to retrieve and store API tokens for Google, GitHub, and many other APIs.

33:55 You get async authorization. You can let your autonomous async agents do work in the background and access the logins that they need. And finally, FGA for RAG. Auth0 allows you to only retrieve documents users have access to, which means you avoid leaking data through your AI. So if you're a Python developer or data scientist looking to build AI-driven apps, get started now with up to 25,000 monthly active users for free at talkpython.fm/Auth0. That's talkpython.fm/Auth0.

34:28 The link is in your podcast player's show notes.

34:30 Thank you so much to Auth0 for supporting the show.

34:34 So we were talking about different databases.

34:36 What about MongoDB just released the Django MongoDB backend.

34:42 Could you use something like that, you think?

34:44 I think so.

34:45 I mean, if it is official and if it supports the Django ORM, I think if it's...

34:50 It does, yeah.

34:51 I don't see any issue with that.

34:54 Because again, all I did was to layer the financial aspect of things on top of Django.

35:02 So my starting point is, hey, anything that you could use with Django, you could use with Django Ledger.

35:07 I mean, it's really that simple.

35:09 It's pretty early days.

35:10 I'm not sure I would recommend it.

35:12 However, I'm a big fan of manga.

35:14 And it's just interesting that it's there.

35:15 But I don't know.

35:16 For these kinds of things, I might actually stick with.

35:19 It might be interesting to test it out.

35:20 I mean, I might take that as a to-do item and see how that turns out.

35:26 Yeah, I'll leave the link to this new Django backend for Mongo.

35:32 It comes from MongoDB.

35:33 The people, you know, they spend a lot of time building it out.

35:36 It's not just some random project that somebody came up with.

35:38 Yeah.

35:39 Yeah.

35:39 So I want to dive into the technical bits and some of the moving parts.

35:43 This ledger idea is really interesting and seeing how that fits, It's almost like you could have subdivisions in your company or divisions within your company, right?

35:54 Like here's the part that deals with the farm, but we also have like a wine and fruit stand at the front.

36:00 Maybe we'll have a separate one for that so we can treat them differently, but we want to see them as also together in the same system.

36:06 You want to maybe talk about how you model those kinds of things?

36:09 Yeah, absolutely.

36:10 So Django Ledger has different ways of kind of like pull data out of the database and to kind of like structure a business in a way that you could get financial reports by departments or by business sections or whatever.

36:28 So one of them is the entity unit model, what I call the entity unit model.

36:34 And it's basically when you create journal entries, you assign that unit to that journal entry, right?

36:42 Not you as a – you don't have to do it manually, but since the blueprints will do most of that for you.

36:48 But the Angular has this capability of chunking down your reporting into separate reports that aggregated together, obviously will give you kind of like the parent balance sheet or the parent income statement, right?

37:05 So you could leverage the units.

37:07 It's called the entity unit to divide your business operations.

37:14 To your point, Michael, it's like if you have your lemonade stand here and then you have a separate side where it deals with a separate office on a different location, you could leverage those units and logically separate the transactions so you could pull reports for specific units as well.

37:32 So it gives you a lot of flexibility when it comes to reporting and to keeping your data nice and clean, so separated and segregated.

37:41 Yeah, that's super neat.

37:42 Could I generate reports?

37:44 Let me rephrase that.

37:45 Will it, without me writing any code, will it generate reports that I could give to an accountant to say, here's our monthly transactions and purchases and go do our bookkeeping with this.

37:58 I know some of them are like, well, just use QuickBooks and then we'll share the QuickBooks thing.

38:02 It's like, well, I don't want to use QuickBooks.

38:04 Yeah, I want something cooler.

38:07 So anyway, yes, answer to your question, yes.

38:10 There is a PDF format.

38:13 There is PDF format support.

38:15 So basically when you pull a financial statement, when you ask for a balance sheet in Django Ledger, in the management UI, you will have a button there that you would click and it will literally create a PDF for you to print and share

38:29 however you like.

38:31 Yeah, nice.

38:31 What about CSV or Excel? I feel like that's probably the primary. That's the JSON of accounting world.

38:39 That's right. I mean, I think that feature right now, it's not implemented.

38:45 It would, you know, pull request welcome.

38:48 I was going to say, PR is welcome.

38:51 You are welcome. Absolutely. Yeah. But, you know, I don't think it would be too hard to implement because, like I said, you know, once you digest, when you call that digest function, which is part of the IO mixing side of things, you know, if you go into the repo, you guys who want to see the code, you know, if you go to the IO mixing and the IO, yeah, you can just go there.

39:14 But, you know, the output of the digest process is just a Python dictionary.

39:19 So at that point, you know, we could just use pandas or polars, you know, or something like that to kind of like save it on a CSV.

39:26 Oh, yeah.

39:27 I hadn't really thought about the pandas or polars side of things.

39:29 Yeah.

39:29 Yeah.

39:30 That makes sense.

39:31 Yeah.

39:31 So you could use Jupyter Notebook as well to integrate with this.

39:34 I use it a lot.

39:36 That's a cool idea.

39:37 Yeah.

39:37 Yeah.

39:38 Yeah.

39:38 I guess you could have a whole suite of notebooks that kind of do the live reporting and stuff.

39:44 And then once you get into the pandas and polars, you can start talking about Dash and other dashboard types of things if you really, really wanted it.

39:52 Yeah, yeah.

39:52 All you need to do is set up your notebook to work with Django.

39:55 And once you do Django, that's set up, you can leverage everything in the Jupyter notebook.

40:01 As a data scientist, you could use HoloViews.

40:03 You could use any plotting library you want.

40:07 So I have a different angle of a question for integrations that comes from the audience, from Joe.

40:13 Joe asked, will it work with Wagtail?

40:16 Are you familiar with Wagtail?

40:17 Yeah, the CMS.

40:19 Yeah, probably the most popular Jingo CMS, which is cool.

40:22 Do you know?

40:22 Do you have any idea?

40:23 I mean, I've certainly not tried to integrate.

40:26 I've not tried to integrate with Wagtail.

40:28 I use Wagtail for some websites that I've built.

40:32 Understand, you know, the Wagtail.

40:35 Again, it's a Django application, right?

40:39 So probably, right?

40:40 I mean, if you're extending and customizing Wagtail, you probably could.

40:44 So if you create a page, because I'm familiar with how Wagtail works.

40:50 So basically, in my mind, I'm kind of like replicating what I would do is basically I would create a page in Wagtail, you know, that page model, right?

40:59 And my understanding is that there's a section where you could create your context.

41:04 You can get your context for your page.

41:06 And at that point, you could bring in Django Ledger and the digest function where you could just get that big Python dictionary and you're going to have all the financial information there and you could just throw it to your template and just populate whatever you want to populate in that website.

41:24 So, yeah, I mean, I don't see any reason why you wouldn't be able to integrate it with Wagtail or something like that.

41:29 Yeah, interesting.

41:31 You know, the world is looking for an alternative to WordPress these days.

41:34 WordPress has gone crazy.

41:36 I don't know if you've been following the drama I'm not I'm way too deep

41:40 into finances right now There's some interesting financial aspects but I don't want to go into it it's a whole different community but basically the main owner of WordPress started demanding a bunch of money from companies that were using it even though it was open source

41:57 it really spooked a lot of people who were really invested in WordPress so looking for alternatives like Wagtail I think it's something that's happening more

42:06 than it did last year.

42:08 And to piggyback off of a little bit of the WordPress concept of this plugin, we know there's a lot of plugins that are being created in WordPress.

42:19 Django Ledger can also work as that foundational kind of like WordPress-like platform where you can bring in via Django app a plugin.

42:28 One example that I'm working on right now is to perform like bank reconciliations, for instance. Bank reconciliations is not something, it is an accounting process. It's not built into Django Ledger itself because that would be, again, I don't want to be opinionated as to what needs to happen from an accounting standpoint. But a bank reconciliation, it's something that I'm creating as a separate Django application. So it wires

43:03 and it looks at each line and goes, what is this and how does that apply and do I need to save it into

43:08 this or not?

43:09 Is that what we're talking about?

43:10 Well, bank reconciliation is you take your bank statement, which has transactions on it, and then you have the transactions that are staged because Django Ledger has a staging area where you bring in your transactions and then you kind of map them and once you click the button, it will go into the actual transaction database.

43:30 And there's a couple other controls that, you know, from a posting standpoint, and whether or not it hits the books or not, other controls are built in.

43:39 But a recon, a financial bank reconciliation, is make sure that the transactions that are in your bank statement match the transactions that are in your database.

43:49 And the starting balance and the end balance match whatever is in your bank, right?

43:57 So it is a regular process.

44:00 us accountants we do to make sure that our data is accurate.

44:04 Right.

44:04 Because if you got more money, there's something that wasn't recorded.

44:08 If you got less money, there's maybe an expense or something that wasn't recorded, right?

44:12 That's right.

44:13 That's right.

44:14 And that can be implemented via plugging.

44:17 Going back to the original point, you can create a Django application that does recons.

44:21 It's called ReconSuite Recoms.

44:23 And just add that functionality to Django Ledger.

44:26 Yeah, that's cool.

44:27 Yep.

44:27 So you said bank statements.

44:28 I imagine a lot of digital companies these days, and even some that are not, probably have Stripe or Square or something like that as well.

44:38 And the way that appears on your bank account is like blobs, right?

44:42 So when you have a bunch of sales, say, through Stripe, Stripe can pay you daily with a couple of days delay.

44:49 And it says today you get this much money.

44:51 But then you've got to go to Stripe to actually see the details that would map over to Django Ledger, right?

44:57 That's right.

44:58 But, you know, Stripe has this API that you would integrate with.

45:04 I'm sure that, you know, you could get the detail and get those transactions into your staging area and then visually looking at them and just pushing the button and integrating those

45:14 into your Django Ledger systems, right?

45:17 A fun in quotes thing you could do is you could actually hook up to the Stripe webhook notifications

45:23 and drive those straight into records in Django Ledger, right?

45:27 Yeah, absolutely.

45:28 I can see that happening.

45:30 Python is such a diverse ecosystem.

45:35 You can do pretty much anything.

45:37 Yeah, that's right.

45:37 I did that on a project not too long ago.

45:40 It's both easy and really hard because you get so much data from Stripe and the scenarios and what it means and stuff.

45:50 It's kind of hard to decipher.

45:52 But hooking into that data flow of a transaction happened, something was refunded or whatever.

45:58 It's pretty straightforward.

45:59 So it sounds like that might be a cool plugin, actually.

46:01 It might be a cool plugin.

46:04 There's many different plugins that we can create for Django Ledger.

46:09 Again, Django Ledger is just a foundation.

46:12 It implements a double entry accounting system.

46:16 It's not an automation framework.

46:18 It doesn't automate a lot of these things.

46:20 Those could be done via plugins, and the community could certainly contribute to those things.

46:26 Yeah, yeah, they could.

46:28 So let's talk licensing.

46:30 Over here I see, well, it's like stuck at the top, which is kind of cool, that it's GPL 3.0.

46:36 So that is a copy left license, right?

46:40 So that means if someone builds an application on top of this and they distribute it, that means it's open source, right?

46:47 Yes.

46:47 As a requirement.

46:48 But if they build on top of this and it's just a private internal thing that powers their accounting or something along those lines, then it doesn't have to be distributed open source.

46:59 Am I understanding that correctly?

47:01 I always get slightly off on my thing.

47:03 I think so.

47:05 I mean, the reasoning behind the GPL version 3 license is that there's a ton of work behind Django Ledger.

47:13 Django Ledger is, there's a lot of domain-specific experience that I've incorporated into Django Ledger for the benefit of the Python community, right?

47:24 So, you know, just like WordPress, WordPress has exactly the same license, you know, and look at what's become, right?

47:31 You know, WordPress is, aside from all the things that may be happening right now, but, you know, it became the foundation for blogging and for content distribution.

47:41 And people and developers were able to develop these plugins, going back to the plugin, you know, topic to extend WordPress, right?

47:50 So my concept with Django Ledger is about the same thing.

47:53 It's like, let's keep it open and let's make sure that we keep it open.

47:57 Anything that is developed on top of Django Ledger is transparent because ultimately it's important that finances are not a black box.

48:06 It shouldn't be a black box, right?

48:09 And for most developers and accountants out there who work with existing platforms, this data is on private servers.

48:18 We don't know what it is.

48:19 Obviously, they have their own policies and their privacy policies and things like that.

48:23 But one of the benefits of Django Ledger is that it is open source.

48:26 You could use your own database, right?

48:28 So you can keep your data private.

48:30 You can control your own data.

48:32 But at the same time, you can extend it, right?

48:35 So all that functionality, I feel like it's really important to keep it open and that there's no bad actors out there who want to leverage something like this and kind of like do something that is not supposed to be, you know, not ethical or anything like that.

48:51 So, but yeah, I think that's, that was my, the main reason behind the licensing, you know, just to make sure that it stays open and that

48:58 if you want to use it for your own commercial purposes, you know, if you distribute it, you need to keep it open.

49:03 You can use it on your own server as a software, as a service, you know, you don't have to distribute that.

49:08 But yeah, so that was it.

49:10 Cool.

49:11 That's my understanding as well.

49:12 If you wanted to have it as a backend for something, that's totally fine.

49:16 But if you wanted to, Basically, if you want to distribute your software built on this, it has to be.

49:22 That's right.

49:22 Your software has to be open source and GPL3.

49:25 Otherwise, not so much.

49:26 That's pretty cool.

49:27 So another thing, obviously, listeners of this show are spread throughout the world, not just the United States.

49:34 And Joe out in the audience asked, basically, can this be used outside the U.S.?

49:39 Does it only work with the United States tax structures?

49:42 Does it have the dollar sign hard-coded?

49:45 Is it going to do multiple currencies?

49:47 currency transfer conversions, that kind of thing.

49:51 So, again, the framework itself is unopinionated.

49:56 So, yes, you can change the dollar sign to whatever you need to change.

50:00 It's actually a Django setting. So you can change it in the settings.

50:06 That would be like your base currency? So if you wanted to do and say euros or whatever, but

50:11 then maybe convert from dollars to euros because you want to think in euros?

50:15 It's literally a character.

50:19 You change the character, and instead of a dollar sign, it will show a euro sign or whatever currency.

50:26 But everything is based on the Django decimal field.

50:30 So the decimal field, it is a two-digit precision decimal field, and it literally can be any currency.

50:38 And to answer the question about tax, Django Ledger doesn't do anything from a tax perspective.

50:44 It's not going to, hey, here's your tax return.

50:46 However, however.

50:47 Could you imagine how hard that would be to write?

50:51 You know, I'll be honest with you.

50:52 I mean, if you understand the tax code of your country, mapping the, again, the digest function, that big dictionary you get back with everything aggregated and nicely done, you could map these accounts to a specific tax line and then do aggregations from there.

51:11 I see. Okay.

51:12 So, you know, when people talk about tax, you know, is this a tax-ready software?

51:19 Really what you're doing is how do you map a financial statement, each line, into a specific tax line for that specific country, which obviously requires knowledge and domain knowledge of the tax

51:30 code for that particular country.

51:32 Yeah.

51:33 Sorry, I just derailed you on talking about multi-currency.

51:36 And multi-currency, out of the box, it does not support multi-currency.

51:43 It doesn't mean it can't.

51:45 I've been kind of like visualizing how to implement multiple currency in an efficient way.

51:51 It's not that it cannot be implemented.

51:55 It just has to be efficient, right?

51:57 And the problem with multi-currency is that it is a very dynamic and it's a living embrace.

52:03 once you make it multi-currency, you basically make it a living and breathing system.

52:09 Why?

52:09 Because currencies value change pretty much every day.

52:12 Every day.

52:13 So what that means is that basically if the rate of exchange changes, now you have some pressure to alleviate from the system, right?

52:24 So, and that needs to be alleviated through what is called like a reconciliation account, you know, in the accounting terms.

52:30 So you can alleviate that pressure in the P&L So everything is kind of like, everything is, it matches the way it should.

52:38 So, yeah.

52:39 Just to give people a sense of like how brutal it can be, even for simple stuff that I do.

52:45 So if I, I did something where somebody paid me with an invoice and I want to record how much income I got, do I record how much it is in your, like, let's say they're paying euros and I'm getting paid.

52:56 It's getting converted to dollars.

52:58 Do I, do I write down how much the currency conversion is when I send the invoice?

53:03 When they pay it, which goes through Stripe, but then Stripe doesn't credit me that or actually process it for some period of time after that.

53:11 Maybe who knows how much longer is it until the day that I get the payout and it's final.

53:16 But there's so many steps that are out of my, that you can't see, you have no visibility into.

53:21 Well, when in the day did Stripe actually finally reconcile that current conversion from euros to dollars?

53:29 And if there was some swing, then stuff doesn't match anymore.

53:32 It's really hard.

53:33 It is hard.

53:35 I mean, I'm sure we can figure something out.

53:39 That's not a problem.

53:40 I mean, it's not a matter of hard or not.

53:43 I think from a Django Ledger standpoint, you know, my concern is to make it as efficient as possible.

53:50 And yeah, and there's other accounting things that, you know, you have to incorporate.

53:57 You know, like to your point, you know, the invoice was written a certain date and then it was paid at a different date.

54:03 Then you need to record kind of like the rate of exchange on a daily basis.

54:07 So you can kind of like alleviate the system on a daily basis and record that kind of like reconciliation transaction because of rate of exchange changes.

54:16 So you just take it to a different level.

54:19 And at that point, I feel like it's going to get interesting.

54:24 That's for sure.

54:25 Yeah.

54:26 Yes, it will.

54:27 All right, two final things that I want to touch on before we close this out.

54:32 One, security.

54:33 Like, what's the security story?

54:35 It sounds like you're probably leveraging a lot of the Django capabilities for security.

54:40 That is correct.

54:41 Yeah, and out of the box, it will use the regular Django Ledger security framework, authorization framework.

54:47 But if you can use, you can use all off.

54:49 You can use, you know, any of the frameworks out there that integrate with Django, you can, you know.

54:56 The permissions are different in Django Ledger because I wanted to enforce permissions at the database layer.

55:06 Not that they're not implemented at the database layer with regular Django auth, but there is a separate table that defines managers and owners of the entities and the companies that are inside Django Ledger.

55:21 Since it is a multi-tenant system, basically you can have, you know, like you could pretty much run an accounting firm, for instance, and you have clients that own certain entities and then the accountant, which owns the entity, can see all the companies.

55:38 Whenever you pull a query set from Django, you have to pass in the user model, right? And that user model is filtering at the database layer, the objects a specific request from a specific user can see and have access to. So I wanted to make it very, you know, very hard for you to show financial data to something or someone that was not supposed to see that data.

56:04 Yeah, that's really cool.

56:05 Maybe someone has permissions to enter transactions, but not see all transactions or something like that.

56:11 Yeah, that's right.

56:12 Yeah, that's a different level of trust to say.

56:15 Yeah.

56:15 Give you all of our sales versus you can record things.

56:18 Okay, and then let's close it out with roadmap. What's the future look like? Where are you going with this thing?

56:24 Well, my initial, so where I want to go first is Django Ledger has been around for a long time.

56:33 So there's a lot of things that I've done in the past that I would have wanted to kind of like do it in a different way.

56:40 So if you see the latest commits, it's just me trying to refactor the code so it's more clear and it's more maintainable long term.

56:49 So as the project evolves, what I want to do is start adding more controls, you know, and more things that are useful from a developer standpoint to integrate with other tools, right?

57:04 We talked about APIs.

57:06 We talked about all the other things, right?

57:09 So as far, you know, to answer a question, the roadmap right now is unclear.

57:16 So it's unclear not because I don't know what to do, but it is going to be based on customer feedback or developer feedback.

57:25 So one of the things that I want to compile is, you know, what developers want.

57:31 So from a functionality standpoint, so I can incorporate those features into Django Legend.

57:37 As a base account system, it's pretty stable.

57:41 From a UI standpoint, I know it could be prettier, but it's not meant to be a full-blown – it's not a drop-in replacement for commercially available software.

57:55 It's meant to be a management UI system.

57:57 So, yeah, I think, you know, going back to what is the roadmap?

58:02 There is a post on my website that I laid out, you know, a couple of things that can be implemented within Django Ledger.

58:13 And one of them is actually the multi-currency, the multi-currency support.

58:17 Right, right.

58:18 So I think that's one of those big items that can definitely be implemented in the short term.

58:25 Testing and coverage, that's another thing.

58:29 More testing, developers who want to add tests, unit tests into the software.

58:36 Those are important.

58:37 One thing to point out is that I am the only developer, not the only, but for pretty much 99% of the code has been written by myself.

58:46 I've written the code.

58:47 So the project is too big.

58:49 I can't focus on all different aspects at the same time.

58:53 So any developer out there who wants to collaborate and wants to throw a PR, PRs are very welcome

58:59 to make it more stable.

59:02 Do you have somewhere that talks about the plugin concept and how to extend it?

59:07 Because, you know, one of those challenges I know many, many people have is they want to add something to some large existing piece of code that's been around for a while.

59:14 And it's like, there's a lot to learn.

59:16 There's a lot to deal with.

59:17 And if you're like, well, you implement these three functions and you do this thing, you know what I mean?

59:21 And that's a much lower barrier to entry.

59:25 Yeah.

59:25 So, again, so one of the things that my objective is to make it more developer friendly because it's the finance and accounting domain sometimes is, again, it's two different brains.

59:38 It's two different brains into one project.

59:40 Yeah.

59:41 And, you know, if you're, if you, and it's a cool project because if you are a programmer, right, you will somehow have to learn accounting or some accounting in order to be a contributor to the project.

59:54 And if you're an accountant, somehow you would need to learn some Python, you know, to be a contributor to the project.

59:59 So one of the challenges with Django Ledger is not only you need to know Django, but also you need to have some sort of financial interest, let's just say,

01:00:08 interest to collaborate to the project.

01:00:12 So, yeah, I mean, it's, you know, one of the challenges that I've had throughout the years is finding collaborators to the project, right?

01:00:20 And that's one of the reasons why Django Ledger, the development has been somehow slow, is because it's mostly my time who is being put into this project.

01:00:31 You should go on a podcast to get some awareness for it.

01:00:33 Yeah, let's do it.

01:00:36 Well, I think there's actually going to be a decent amount of interest.

01:00:39 There's a lot of people out there who are developers, but they've got to work on accounting systems.

01:00:44 They're like, well, I don't know enough to build one from scratch, but maybe contribute to one.

01:00:49 But PRs are welcome and contributors are welcome.

01:00:52 100%, please.

01:00:54 I also noticed you have a Discord community and a Getting Started Guide.

01:00:59 Yes.

01:00:59 Yeah.

01:00:59 So the Discord, I'm on the Discord so you guys can ask questions.

01:01:04 You know, anybody who wants to report a bug or has some ideas on Django Ledger, you can definitely join the Discord.

01:01:11 The Get Started Guide, it is a developer-focused guide that I put together for developers to get familiar with, to bring them in, somehow get their feet wet into accounting from a developer perspective.

01:01:27 So there's some table, there's some concepts there that I try to explain from a developer standpoint.

01:01:34 So it's not too daunting.

01:01:36 So it's not too intimidating.

01:01:39 So that's a good resource to have.

01:01:42 All right.

01:01:42 Excellent.

01:01:43 I'll put links to those in the show notes.

01:01:45 Well, thanks for being on the show.

01:01:47 Congrats on the project.

01:01:47 It looks really cool.

01:01:48 Well, thank you for having me, Michael.

01:01:50 It was fun.

01:01:51 Yeah.

01:01:51 Yeah, it sure was.

01:01:52 See you later.

01:01:52 See ya.

01:01:54 This has been another episode of Talk Python to Me.

01:01:57 Thank you to our sponsors.

01:01:58 Be sure to check out what they're offering.

01:02:00 It really helps support the show.

01:02:02 This episode is sponsored by Auth0.

01:02:04 Auth0 is an easy to implement, adaptable authentication and authorization platform.

01:02:09 Think easy user logins, social sign-on, multi-factor authentication, and robust role-based access control.

01:02:16 With over 30 SDKs and quick starts, Auth0 scales with your product at every stage.

01:02:21 Get 25,000 monthly active users for free at talkpython.fm/Auth0.

01:02:27 Want to level up your Python?

01:02:29 We have one of the largest catalogs of Python video courses over at Talk Python.

01:02:33 Our content ranges from true beginners to deeply advanced topics like memory and async.

01:02:38 And best of all, there's not a subscription in sight.

01:02:40 Check it out for yourself at training.talkpython.fm.

01:02:44 Be sure to subscribe to the show, open your favorite podcast app, and search for Python.

01:02:48 We should be right at the top.

01:02:50 You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.

01:02:59 We're live streaming most of our recordings these days.

01:03:02 If you want to be part of the show and have your comments featured on the air, Be sure to subscribe to our YouTube channel at talkpython.fm/youtube.

01:03:10 This is your host, Michael Kennedy.

01:03:12 Thanks so much for listening.

01:03:13 I really appreciate it.

01:03:14 Now get out there and write some Python code.

Talk Python's Mastodon Michael Kennedy's Mastodon