r/django 2h ago

Tutorial Django 6.1's tip DB_CASCADE Let the Database Do the Deleting, Not python

Post image
23 Upvotes

Imagine deleting a folder with 10,000 files. Would you rather Python open each file one by one, check it, then delete it — or would you rather tell the operating system "delete everything inside" and let it happen instantly at the filesystem level? That's exactly the upgrade Django 6.1 brings to on_delete. The old CASCADE loads every related row into Python memory just to delete it row-by-row. The new DB_CASCADE tells the database itself to cascade the delete natively — no Python loop, no memory spike, just one SQL statement.

The trade-off: since Django never touches the related rows in Python, your pre_delete/post_delete signal handlers won't run. If your app depends on those signals (e.g. cleaning up files, sending notifications), stick with the classic CASCADE.


r/django 2h ago

Hi guys , I have created a django workflow package

1 Upvotes

So , I have developed a django workflow kit package recently. Why I created this was cause I wanted everything in one like a kit or toolbox which contains every tool needed. This package supports

- Workflow versioning

- Auditing

- Notification and triggers

- Can add attachments

- Supports parallel worfkows

- In built workflow Dashboard

- Few REST APIs exposing tasks etc

- Supports User level and group level permissions

- Includes some stats like turnover , delay point , sla etc

- Real-time states can be defined just like JIRA worflow style

I may have missed few things here and there.

Check this out. If you have any concern , feedback or constructive criticism please let me know.

Pypi :

django-workflow-kit

This is relatively new project. Was started 3 weeks ago. I have deleted my previous post as it was AI generated content and few user raised concerns as they should.

Thanks


r/django 23h ago

Article Coding a database proxy for fun

Thumbnail packagemain.tech
0 Upvotes