# Asyncifying django.contrib.auth? (and signals, and maybe sessions)

**URL:** <https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-signals-and-maybe-sessions/18770>\
**Category:** Async\
**Created:** [February 10, 2023, 11:09pm UTC](https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-signals-and-maybe-sessions/18770 "2023-02-10T23:09:49Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![bigfootjon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/bigfootjon/32/12068_2.png) [@bigfootjon](https://forum.djangoproject.com/u/bigfootjon)\
**Post date:** [April 11, 2024, 11:08pm UTC](https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-signals-and-maybe-sessions/18770/29 "2024-04-11T23:08:17Z")

</div>

> I’m currently a bit sceptical about extending async very much further into the `contrib` modules, due to the limited need/benefit, and the large amount of duplication we run into due to [the _function color_ problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/)

Yeah totally, that’s one of the things I called out at the very beginning of this process:

> B. Are there proven strategies for reducing code duplication between sync and async versions of functionality in Django or in Python broadly?..

My reading of [DEP009](https://github.com/django/deps/blob/main/accepted/0009-async.rst) is that the extended goal of async django is to replace all the sync code with async wrappers eventually, so I was just hacking away on that goal. I was specifically thinking about these lines in that DEP:

> The overall goal is to have every single part of Django that could be blocking -that is, which is not just simple CPU-bound computation - be async-native (run in an asynchronous event loop without blocking).  
> This includes features like:
> 
> - Middleware
> - Views
> - The ORM
> - Templating
> - Testing
> - Caching
> - Form validation
> - Emails

If that DEP is no longer current I’d be eager to read what has superseded it!

> It’s certainly more intimidating but ORM-native wrappers around async DB connections, and streaming queries, and so on strike me as something that’s going to yield much better returns.

Yeah I just feel a bit too intimidated to get started on that right now, but maybe it is time to give it a closer look!

---

_[View the full topic](https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-signals-and-maybe-sessions/18770)._
