django-http-last-modified-view

Django http Last-Modified header view mixin


Keywords
django, Last-Modified, header, view
License
Unlicense
Install
pip install django-http-last-modified-view==2020.10.29

Documentation

Installation

$ [sudo] pip install django-http-last-modified-view
views.py

get_http_last_modified

from django_http_last_modified_view.views import HttpLastModifiedMixin

class MyView(HttpLastModifiedMixin,...):

    def get_http_last_modified(self):
        return self.obj.http_last_modified

dispatch, self.http_last_modified:

class MyView(HttpLastModifiedMixin,...):
    def dispatch(self, *args, **kwargs):
        self.http_last_modified = obj.last_modified_at
        return super().dispatch(*args, **kwargs)

readme42.com