No project description provided
Project description
mixins
Custom Django mixins for class based views
Getting started
Install mixins
:
pip install dj-mixins
Now you can start using the mixins.
Usage
Let's say that we want to implement a view that accepts requests from superusers only. To achieve this we can use SuperUserMixin
:
""" Views.py """
from django.views.generic import TemplateView
from mixins.mixins import SuperUserMixin
# Create your views here.
class SuperUserView(SuperUserMixin, TemplateView):
""" A view that accepts request from superusers only """
template_name = 'myapp/index.html'
I hope that you find this useful.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
dj_mixins-0.1.1-py3-none-any.whl
(35.3 kB
view hashes)
Close
Hashes for dj_mixins-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e346b0f91f69de2c2ecafeb3c1f2aa7aa430f608ac2a6b78cffaae5fc6ffa91b |
|
MD5 | cf1283f92e84f65b22553ba5d94ab4fc |
|
BLAKE2b-256 | 6528deeecef36ec30adb41c0d65bc94fe945cc5e94a16d4dee5a3eb9ca1256c0 |