Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

robots.txt File Generation Django

Project Description

Installation from Source

$ git clone
$ cd django-robots
$ python install

Installation via PIP Requirements File

Include in the PIP requirements file the following line:

-e git://

And then install as normal (IE:)

$ pip install -r path/to/requirements/file.txt


$ python test

With TOX

First, install Tox, then run the tests. This will test against the Django versions specified in the environments specified in the tox.ini file

$ pip install tox
$ tox

Setup the Project For the Application

Add to the project’s file tuple of installed apps:


In the project’s file add:

url(r'^robots.txt', include('django_robots.urls')),

Enable the sites framework in the project’s file:

  1. Add 'django.contrib.sites' to your INSTALLED_APPS setting.
  2. Define a SITE_ID setting:
  1. Run syncdb.

From the Django Admin, configure the Domain Name and Display Name for the site, the domain name will be used in the robots.txt file to point to the absolute URL of the site’s sitemap.xml file.

Configure the robots.txt Template

By default the robots.txt template only includes a directive to point to the sitemap at http://site_url/sitemap.xml. This should be removed if the site doesn’t have an XML sitemap for some reason. If you’re using virtualenv, to copy the templates from the project in order to make adjustments to them, cd to the root of the django project and execute the following command:

cp -r ../src/django-robots/django_robots/templates/robots templates/robots

Template Tags Installed


Returns a full URL for the current site including custom protocol and port if set (i.e.

Example usage:

{% load current_site_url %}
{% current_site_url %}

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(8.1 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Dec 2, 2015
(4.8 kB) Copy SHA256 Hash SHA256
Source None Dec 2, 2015

Supported By

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