This is a simple application to create a robots.txt file for django. It has no models at all and you’re supposed to edit a template to update the robots.txt file. I got tired of having to add this view to each and every project because Django doesn’t have a built in text/plain view.
See the robots page for details what the file should look like.
Usage
Get django-robots-txt into your python path:
pip install django-robots-txt
Create your custom robots.txt file in one of your template directories as robots_txt/robots.txt.
Add a robots.txt view to your root urls.py:
from django.conf.urls.defaults import patterns, include, url
from robots_txt.views import RobotsTextView
urlpatterns = patterns('',
...,
url(r'^robots.txt$', RobotsTextView.as_view()),
...,
)
That’s it, your robots.txt template will be served.
This urlconf entry is also supported if you prefer to keep it short:
urlpatterns = patterns('',
...,
url(r'', include('robots_txt.urls')),
...,
)
You can add robots_txt to your INSTALLED_APPS in settings.py if you don’t want to create your own template and don’t mind having an empty robots.txt:
INSTALLED_APPS = (
...,
'robots_txt',
...,
)
Changes
0.4: - Refactor tests - Updates for Django 1.6
0.3: - Bugfix for included urlconfig
Metadata
Release files for django-robots-txt 0.4
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 | Actions |
|---|---|---|---|---|
| django-robots-txt-0.4.tar.gz | 3.5 kB | Without provenance | Details for django-robots-txt-0.4.tar.gz |
Release files / django-robots-txt-0.4.tar.gz
| Download URL | django-robots-txt-0.4.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f68cd0ec4b0a096d5fb47d49df25436828fa4656f1dafd655a1cfd66d053981
|
|
BLAKE2b-256 checksum How to use checksums |
6e65ad07618eef777f4735b578d925fa532bc9c94af8a9349a3c08776c740cf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-robots-txt 0.4
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.