Extra decorators for your Django project.
Project description
Description
This package provides decorators to make building websites in Django even easier.
Installation
$ pip install django-decorator-plus
Basic Usage
The package currently supplies decorators to improve your views.
View Decorators
The view decorators provided are meant to restrict the HTTP methods allowed on a view. The require_safe_methods limits views to GET and HEAD and generates a proper response for OPTIONS.
from decorator_plus import require_safe_methods
@require_safe_methods
def function_view_safe(request):
...
The package also supplies the require_form_methods decorator, which limits views to GET, HEAD, and POST. Both of these decorators are actually just shortcuts on top of the require_http_methods() decorator, which is an enhanced version of the decorator supplied by Django by the same name; the require_http_methods() decorator automatically supplies the OPTIONS HTTP method, and will automatically add the HEAD HTTP method if the GET method is allowed.
For more information and examples, please see the full Package Documentation.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-decorator-plus-0.0.1a2.zip.
File metadata
- Download URL: django-decorator-plus-0.0.1a2.zip
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee2275f1be19ce24cbe92794311772483dff17a173d03cb78eac5eb9d27ece5e
|
|
| MD5 |
4f034b75f5d85d3957d783089fadd750
|
|
| BLAKE2b-256 |
5abe8ce9d1ddd93089835342e694e7e9306f165e2d325c6d21950015a2b9f4c8
|
File details
Details for the file django-decorator-plus-0.0.1a2.tar.gz.
File metadata
- Download URL: django-decorator-plus-0.0.1a2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d2b6df30d23a32a982bae230a4277811b78e78e15daa6bb78b5ef821040537d
|
|
| MD5 |
e764ee69435b4dc4d94273688bba493c
|
|
| BLAKE2b-256 |
f6f9f2a9f1aedf481f8f46ccebd011f7ea1560f08ae9456c524fe7c00f7f776e
|
File details
Details for the file django_decorator_plus-0.0.1a2-py2.py3-none-any.whl.
File metadata
- Download URL: django_decorator_plus-0.0.1a2-py2.py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97e95ead324b288a139c0ae444d04e4a7a370f389b7e040f51ffe6cb5fc5c94e
|
|
| MD5 |
d82136895b1c078c51090164609f374b
|
|
| BLAKE2b-256 |
5bbde01e28a55dd7392d8bae83dfc0a6e9347c11974e27552fde0d0cac369232
|