Skip to main content

Extra decorators for your Django project.

Project description

Package Documentation

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

django-decorator-plus-0.0.1a2.zip (9.6 kB view details)

Uploaded Source

django-decorator-plus-0.0.1a2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_decorator_plus-0.0.1a2-py2.py3-none-any.whl (6.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-decorator-plus-0.0.1a2.zip.

File metadata

File hashes

Hashes for django-decorator-plus-0.0.1a2.zip
Algorithm Hash digest
SHA256 ee2275f1be19ce24cbe92794311772483dff17a173d03cb78eac5eb9d27ece5e
MD5 4f034b75f5d85d3957d783089fadd750
BLAKE2b-256 5abe8ce9d1ddd93089835342e694e7e9306f165e2d325c6d21950015a2b9f4c8

See more details on using hashes here.

File details

Details for the file django-decorator-plus-0.0.1a2.tar.gz.

File metadata

File hashes

Hashes for django-decorator-plus-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 6d2b6df30d23a32a982bae230a4277811b78e78e15daa6bb78b5ef821040537d
MD5 e764ee69435b4dc4d94273688bba493c
BLAKE2b-256 f6f9f2a9f1aedf481f8f46ccebd011f7ea1560f08ae9456c524fe7c00f7f776e

See more details on using hashes here.

File details

Details for the file django_decorator_plus-0.0.1a2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_decorator_plus-0.0.1a2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 97e95ead324b288a139c0ae444d04e4a7a370f389b7e040f51ffe6cb5fc5c94e
MD5 d82136895b1c078c51090164609f374b
BLAKE2b-256 5bbde01e28a55dd7392d8bae83dfc0a6e9347c11974e27552fde0d0cac369232

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page