This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
docs
tests

package

A Django middleware that inspects the HTTP Acept headers sent by browsers. It adds a new method to each request instance called accepts(str) which can be used to determine if a certain mimetype is accepted by the user agent that issued the request.

Installation

pip install django-accept-header

Usage

First add the middleware to your settings.py file:

MIDDLEWARE_CLASSES = (
    # ...
    'django_accept_header.middleware.AcceptMiddleware',
)

To check if the text/plain mimetype is accepted by the user agent:

def some_view(request):
    if request.accepts('text/plain'):
        # do something

The ordered list of accepted mimetypes can also be used:

def some_view(request):
    for media_type in request.accepted_types:
        # do something

See the full documentation for how to use the media types please see the full documentation.

Development

To run the all tests run:

tox

0.3.0 / 2016-02-02

  • Change package name to django-accept-header.
  • Make python3.5 the default version used for tests.

0.1.0 / 2015-11-26

  • First release on PyPI.
Release History

Release History

0.3.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_accept_header-0.3.2-py2.py3-none-any.whl (17.4 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Feb 2, 2016
django-accept-header-0.3.2.tar.gz (11.8 kB) Copy SHA256 Checksum SHA256 Source Feb 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting