Metadata-Version: 2.1
Name: django-plugin-django-header
Version: 0.1
Summary: Add a Django-Compositions HTTP header to a Django app
Author: Simon Willison
License: Apache-2.0
Project-URL: Homepage, https://github.com/simonw/django-plugin-django-header
Project-URL: Changelog, https://github.com/simonw/django-plugin-django-header/releases
Project-URL: Issues, https://github.com/simonw/django-plugin-django-header/issues
Project-URL: CI, https://github.com/simonw/django-plugin-django-header/actions
Classifier: License :: OSI Approved :: Apache Software License
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django
Requires-Dist: djp
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-django; extra == "test"

# django-plugin-django-header

[![PyPI](https://img.shields.io/pypi/v/django-plugin-django-header.svg)](https://pypi.org/project/django-plugin-django-header/)
[![Changelog](https://img.shields.io/github/v/release/simonw/django-plugin-django-header?include_prereleases&label=changelog)](https://github.com/simonw/django-plugin-django-header/releases)
[![Tests](https://github.com/simonw/django-plugin-django-header/workflows/Test/badge.svg)](https://github.com/simonw/django-plugin-django-header/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/django-plugin-django-header/blob/main/LICENSE)

Add a Django-Compositions HTTP header to a Django app

## Installation

Configure [djp](https://github.com/simonw/djp). Then install this plugin in the same environment as your Django application.
```bash
pip install django-plugin-django-header
```
## Usage

Once installed, every response from the application will include a `Django-Composition` HTTP header. For example:

```bash
curl -I http://localhost:8000/
```
```
HTTP/1.1 200 OK
Server: WSGIServer/0.2 CPython/3.12.0
Content-Type: text/html; charset=utf-8
Django-Composition: Castle of My Dreams
...
```

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd django-plugin-django-header
python -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
python -m pytest
```
