Skip to content

Instantly share code, notes, and snippets.

View DonerKebab's full-sized avatar
💀

Phuong Nguyen DonerKebab

💀
View GitHub Profile
@DonerKebab
DonerKebab / mixin.py
Created November 7, 2017 02:50 — forked from cyberdelia/mixin.py
Django class based view mixins
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.utils.cache import patch_response_headers
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page, never_cache
from django.views.decorators.csrf import csrf_exempt
class NeverCacheMixin(object):
@method_decorator(never_cache)