# How to integrate aerospike with Django to avoid multiple connections

**URL:** <https://discuss.aerospike.com/t/how-to-integrate-aerospike-with-django-to-avoid-multiple-connections/4151>\
**Category:** Python Client\
**Created:** [May 12, 2017, 3:22pm UTC](https://discuss.aerospike.com/t/how-to-integrate-aerospike-with-django-to-avoid-multiple-connections/4151 "2017-05-12T15:22:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tawanda\_Minya](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@Tawanda\_Minya](https://discuss.aerospike.com/u/Tawanda_Minya)\
**Post date:** [May 12, 2017, 3:22pm UTC](https://discuss.aerospike.com/t/how-to-integrate-aerospike-with-django-to-avoid-multiple-connections/4151/1 "2017-05-12T15:22:16Z")

</div>

I see in the docs you use this pattern

1. Connect to aerospike
2. Read write data
3. Disconnect

Now if my front end application is making thousands of requests it will mean thousands of connections to aerospike

Can i connect once like in the settings and use the same connection for all requests. If i do it on settings load my only question is how do i disconnect gracefully on application exit
