2👍
✅
Yes, that’s possible.
from django.db import transaction
def viewfunc(request):
# This code executes in autocommit mode (Django's default).
do_stuff()
with transaction.atomic():
# This code executes inside a transaction.
do_more_stuff()
Source: https://docs.djangoproject.com/en/1.9/topics/db/transactions/#django.db.transaction.atomic
Source:stackexchange.com