Our internal utility to easily have robots.txt both for development and production
Install
pip install djrobots
Usage
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 website, use in your settings
DJROBOTS_DISALLOWALL = True
Sitemap
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']
Customization
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' %}
Host: example.com
{% endblock %}
Run tests
$ pip install -r requirements-dev.txt
$ make test
Metadata
Release files for djrobots 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| djrobots-0.0.8.tar.gz | 4.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djrobots-0.0.8-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 9.9 kB
Release files / djrobots-0.0.8.tar.gz
| Download URL | djrobots-0.0.8.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1483bb82d9be261251ed481dc068ace2f0d8b75c50e31d905bed36e5a057efe
|
|
BLAKE2b-256 checksum How to use checksums |
c5a87dff03b97cbf619a00d5414806f17a89802170ec2f6ae1e59116ddffa10f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
|
Release files / djrobots-0.0.8-py2.py3-none-any.whl
| Download URL | djrobots-0.0.8-py2.py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e8e42eb8cdb96f985c1898b4290322d8215944e080e9cf9d975c0f66ee542b06
|
|
BLAKE2b-256 checksum How to use checksums |
9bc33e57672d0a504f81a319cacb0a34dc750e9cc137c387375638a70f61e119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
|
Security for djrobots 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.