# generic views and async

**URL:** <https://forum.djangoproject.com/t/generic-views-and-async/29047>\
**Category:** Async/Channels\
**Created:** [March 13, 2024, 7:35pm UTC](https://forum.djangoproject.com/t/generic-views-and-async/29047 "2024-03-13T19:35:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirreza8002](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/amirreza8002/32/27683_2.png) [@amirreza8002](https://forum.djangoproject.com/u/amirreza8002)\
**Post date:** [March 13, 2024, 7:35pm UTC](https://forum.djangoproject.com/t/generic-views-and-async/29047/1 "2024-03-13T19:35:22Z")

</div>

hi  
so i’m not sure if this has been discussed before or not  
i did search but answers seem to be old

so i want to use asgi for my new porject and my habbit is to use generic views and class based views

but i’m kinda stuck in the sense that i don’t know how much of the generic views should i overwrite in order for async to work

or perhaps django does this for me somehow?

for example if i want to use a `CreateView`, should i overwrite the methods such as `get`, `post`, `get_context_data`, and… to be async and use `await` in then and other async stuff  
or what?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 31, 2024, 4:48pm UTC](https://forum.djangoproject.com/t/generic-views-and-async/29047/3 "2024-03-31T16:48:43Z")

</div>

> [@amirreza8002](#):
>
> but i’m kinda stuck in the sense that i don’t know how much of the generic views should i overwrite in order for async to work

At a minimum, you’re going to need to adapt all ORM-related operations and the rendering process. For example in a detail view, this means overriding (at least) the `get_object` and `render_to_response` methods.

You don’t need to override the various methods that just bounce you from method to method.

If you’re really serious about this, I’d suggest you create your own async-friendly CBVs and inherit from them in your code.

Otherwise, you’re probably just as well off marking the entire view as sync and letting it go at that.
