Django powered cms
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file djrobots-0.0.8.tar.gz
.
File metadata
- Download URL: djrobots-0.0.8.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1483bb82d9be261251ed481dc068ace2f0d8b75c50e31d905bed36e5a057efe |
|
MD5 | d781d864a1ade0f755a59a71e63da494 |
|
BLAKE2b-256 | c5a87dff03b97cbf619a00d5414806f17a89802170ec2f6ae1e59116ddffa10f |
File details
Details for the file djrobots-0.0.8-py2.py3-none-any.whl
.
File metadata
- Download URL: djrobots-0.0.8-py2.py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 2, Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8e42eb8cdb96f985c1898b4290322d8215944e080e9cf9d975c0f66ee542b06 |
|
MD5 | 89e6c90d0a8f3d21bda36ec55048bdd2 |
|
BLAKE2b-256 | 9bc33e57672d0a504f81a319cacb0a34dc750e9cc137c387375638a70f61e119 |