https://github.com/lispython/django-branding
Application to set custom headers to response
https://github.com/lispython/django-branding
Last synced: about 1 month ago
JSON representation
Application to set custom headers to response
- Host: GitHub
- URL: https://github.com/lispython/django-branding
- Owner: Lispython
- License: other
- Created: 2012-04-29T13:24:11.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-02-17T10:28:56.000Z (about 12 years ago)
- Last Synced: 2024-10-17T16:21:28.484Z (7 months ago)
- Language: Python
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
django-branding
---------------Add branding headers to response.
Requirements
============* Django
Installation
============Install it with pip (or easy_install)::
pip install django-branding
Usage
=====Add branding middleware from branding to you django config
MIDDLEWARE_CLASSES += 'branding.middleware.BrandingMiddleware',
Define headers variables in settings
BRANDING = {
'X-Programming': 'Lispython',
'X-Revision': '232134'
}X_SERVER = "Super Server"
Example
=======Example of headers on http://dzone.me
In [1]: import human_curl as hurl
In [2]: r = hurl.get('http://dzone.me')
In [3]: r.headers
Out[3]:
{'cache-control': 'max-age=600',
'connection': 'keep-alive',
'content-language': 'ru-ru',
'content-length': '55239',
'content-type': 'text/html; charset=utf-8',
'date': 'Sun, 29 Apr 2012 12:51:12 GMT',
'expires': 'Sun, 29 Apr 2012 13:01:12 GMT',
'last-modified': 'Sun, 29 Apr 2012 12:51:12 GMT',
'link': '; rel="platform"',
'server': 'Super Server',
'vary': 'Accept-Language, Cookie, Accept-Encoding',
'x-powered-by': 'D Zone',
'x-programming': 'Alex Lispython ([email protected], github.com/lispython)',
'x-revision': '5215de3',
'x-version': '20120311.0013-0'}