Skip to main content


Project description

Logo Build Status codecov Latest Version

Our internal utility to easily have robots.txt both for development and production


pip install djrobots


Include djrobots urls to your URLconf and your’re done!

(r'^robots\.txt$', include('djrobots.urls')),

and add djrobots to your INSTALLED_APPS.

If you want to disable all in your site, use in your settings



If you want to specify the sitemap urls in your robots.txt, provide the view name in the settings

DJROBOTS_SITEMAPS = 'sitemap-root'

DJROBOTS_SITEMAPS is a special setting, you can use an array to specify more sitemaps in your robots.txt

DJROBOTS_SITEMAPS = ['sitemap-root', 'department-sitemap']

or you can mix view names with raw urls

DJROBOTS_SITEMAPS = ['sitemap-root', 'department-sitemap', '/my-sitemap-index.xml']


By default djrobots provides a robots.txt template for production and a robots-debug.txt for development with a default configuration used internally at Lotrek.

If you want to specify more directives you can extend default templates, robots.txt and robots-debug.txt

{% extends "djrobots/base-robots.txt" %}
{% block content %}
User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: {% url 'documents' %}


{% endblock %}

Run tests

$ pip install -r requirements-dev.txt
$ make test

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 djrobots, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size djrobots-0.0.7-py3-none-any.whl (6.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size djrobots-0.0.7.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page