mirror of
https://github.com/Hopiu/django.git
synced 2026-04-02 14:20:25 +00:00
18 lines
497 B
Python
18 lines
497 B
Python
|
|
# -*- coding:utf-8 -*-
|
||
|
|
from django.views.decorators.http import condition
|
||
|
|
from django.http import HttpResponse
|
||
|
|
|
||
|
|
from models import FULL_RESPONSE, LAST_MODIFIED, ETAG
|
||
|
|
|
||
|
|
@condition(lambda r: ETAG, lambda r: LAST_MODIFIED)
|
||
|
|
def index(request):
|
||
|
|
return HttpResponse(FULL_RESPONSE)
|
||
|
|
|
||
|
|
@condition(last_modified_func=lambda r: LAST_MODIFIED)
|
||
|
|
def last_modified(request):
|
||
|
|
return HttpResponse(FULL_RESPONSE)
|
||
|
|
|
||
|
|
@condition(etag_func=lambda r: ETAG)
|
||
|
|
def etag(request):
|
||
|
|
return HttpResponse(FULL_RESPONSE)
|