Skip to main content

Extra decorators for your Django project.

Project description

Package Documentation


This package provides decorators to make building websites in Django even easier.


$ 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

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 (9.6 kB view hashes)

Uploaded source

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

Uploaded source

Built Distribution

Supported by

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