django-x-robots-tag-middleware

Enables returning the X-Robots-Tag header based on Django settings.


Keywords
django, django-middleware, middleware, seo
License
MIT
Install
pip install django-x-robots-tag-middleware==1.3.3

Documentation

Django X-Robots-Tag Middleware

PyPi Package Version Python package codecov Scrutinizer Code Quality Documentation Status

Simple Django middleware to send the X-Robots-Tag header to all URLs. Useful for ensuring a site in development is not accidentally picked up and indexed until it is ready.

Installation

From pypi:

$ pip install django-x-robots-tag-middleware

Usage

  1. Add "x_robots_middleware.XRobotsMiddleware", to your middleware list in settings.py.

  2. Add X_ROBOTS_TAG = ["noindex", "nofollow"] to your settings.py with the values you want for the X_ROBOTS_TAG.

Details about the values for the tag and what they do can be found in the Google Documentation.