mirror of
https://github.com/Hopiu/django.git
synced 2026-05-14 02:23:09 +00:00
18 lines
523 B
Python
18 lines
523 B
Python
|
|
from __future__ import unicode_literals
|
||
|
|
|
||
|
|
from django.db import connection
|
||
|
|
from django.http import HttpResponse, StreamingHttpResponse
|
||
|
|
|
||
|
|
def regular(request):
|
||
|
|
return HttpResponse(b"regular content")
|
||
|
|
|
||
|
|
def streaming(request):
|
||
|
|
return StreamingHttpResponse([b"streaming", b" ", b"content"])
|
||
|
|
|
||
|
|
def in_transaction(request):
|
||
|
|
return HttpResponse(str(connection.in_atomic_block))
|
||
|
|
|
||
|
|
def not_in_transaction(request):
|
||
|
|
return HttpResponse(str(connection.in_atomic_block))
|
||
|
|
not_in_transaction.transactions_per_request = False
|