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.

The require_http_methods() decorator is an enhanced version of the decorator supplied by Django.

@require_http_methods(["GET", "POST"])
def function_view(request):
    # HTTP methods != GET or POST results in 405 error code response

The require_http_methods() automatically supplies the OPTIONS HTTP method, and will automatically add the HEAD HTTP method if the GET method is allowed.

The package also supplies two shortcut decorators for your most common tasks:

  • require_safe_methods limits views to GET and HEAD.
  • require_form_methods limites views to GET, HEAD, and POST.

Project details

Download files

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

Files for django-decorator-plus, version 0.0.1a1
Filename, size File type Python version Upload date Hashes
Filename, size django_decorator_plus-0.0.1a1-py2.py3-none-any.whl (6.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-decorator-plus-0.0.1a1.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View
Filename, size (9.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page