django-roberts
A simple Django app to serve a robots.txt file.
Requirements
Django 1.2 or greater, Python 2.7 or greater.
Installation
Use your favorite Python installer to install it from PyPI:
pip install django-roberts
Or get the source from the application site:
hg clone https://bitbucket.org/mhurt/django-roberts
The robots package, included in the distribution, should be placed on the PYTHONPATH.
Configuration
Add
robotsto yourINSTALLED_APPSsetting.Include the package’s url patterns in your root
urls.py:url(r'', include('robots.urls')),
If your run Django’s development server you should now be able to see the example robots.txt file at http://127.0.0.1:8000/robots.txt
Extras
For convenience the package defines the usable combinations of robots directives which can be used in your views and templates.
The following constants are defined:
NOINDEX_FOLLOW
INDEX_NOFOLLOW
NOINDEX_NOFOLLOW
Here’s a simple example of using these constants in practice…
In your view:
# views.py
import robots
class MyView(ListView):
meta_robots = robots.NOINDEX_FOLLOW
...
...
In your base template:
# base.html
<html>
<head>
...
{% include 'robots/meta_robots.html' %}
<!-- OR -->
{% if view.meta_robots %}
<meta name="robots" content="{{ view.meta_robots }}">
{% endif %}
...
...
Python package
The Python package is available from PyPI
Get the source code
From our BitBucket repository.
Report a bug
Please report any bugs through our Issue Tracker.
Metadata
Release files for django-roberts 0.1.3
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-roberts-0.1.3.tar.gz | 4.1 kB | Without provenance | Details for django-roberts-0.1.3.tar.gz |
Release files / django-roberts-0.1.3.tar.gz
| Download URL | django-roberts-0.1.3.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d288284b02049d7cd78f63546f70fb9cf961ea2454e1621b93a46487468f2b3
|
|
BLAKE2b-256 checksum How to use checksums |
35263f0f72590e96840da51491e664e9751b42b9789b847c26121aa0b3f8dec8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-roberts 0.1.3
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.