Skip to content

Commit d167eae

Browse files
author
Josh Owen
committed
updated docs
1 parent 3323f06 commit d167eae

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ include LICENSE
44
include MANIFEST.in
55
include README.rst
66

7-
graft robots
8-
recursive-exclude robots *.pyc *.pyo
7+
graft url_robots
8+
recursive-exclude url_robots *.pyc *.pyo

README.rst

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=========================
2-
django-robots
2+
django-url-robots
33
=========================
44

55
``Django`` ``robots.txt`` generator. Based on using decorated ``django.conf.urls.url``.
@@ -8,44 +8,44 @@ It gets ``urlpatterns`` and replaces ambiguous parts by ``*``.
88
Installation & Usage
99
=========================
1010

11-
The recommended way to install django-robots is with `pip <http://pypi.python.org/pypi/pip>`_
11+
The recommended way to install django-url-robots is with `pip <http://pypi.python.org/pypi/pip>`_
1212

1313
1. Install from PyPI with ``easy_install`` or ``pip``::
1414

15-
pip install git+https://github.com/valeriansaliou/django-robots
15+
pip install django-url-robots
1616

17-
2. Add ``'robots'`` to your ``INSTALLED_APPS``::
17+
2. Add ``'url_robots'`` to your ``INSTALLED_APPS``::
1818

1919
INSTALLED_APPS = (
2020
...
21-
'robots',
21+
'url_robots',
2222
...
2323
)
2424

25-
3. Add robots view to your root URLconf::
25+
3. Add url_robots view to your root URLconf::
2626

27-
urlpatterns += patterns('',
28-
url(r'^robots\.txt$', 'robots.views.robots_txt'),
29-
)
27+
urlpatterns += [
28+
url(r'^robots\.txt$', robots.views.robots_txt),
29+
]
3030

3131
4. Describe rules by boolean keyword argument ``robots_allow`` using for it ``robots.utils.url`` instead ``django.conf.urls.url``::
3232

33-
from robots.utils import url
33+
from url_robots.utils import url
3434
35-
urlpatterns += patterns('',
36-
url('^profile/private$', 'view', robots_allow=False),
37-
)
35+
urlpatterns += [
36+
url('^profile/private$', views.some_view, robots_allow=False),
37+
]
3838
39-
``django-robots`` tested with ``Django-1.3``. Encodes unicode characters by percent-encoding.
39+
``django-url-robots`` tested with ``Django-1.3``. Encodes unicode characters by percent-encoding.
4040

4141
Settings
4242
====================
4343

4444
In this moment there are only one option to define template of ``robots.txt`` file::
4545

46-
urlpatterns += patterns('',
47-
url(r'^robots\.txt$', 'robots.views.robots_txt', {'template': 'my_awesome_robots_template.txt'}),
48-
)
46+
urlpatterns += [
47+
url(r'^robots\.txt$', url_robots.views.robots_txt, {'template': 'my_awesome_robots_template.txt'}),
48+
]
4949

5050
Example
5151
===================
@@ -57,23 +57,22 @@ robots_template.txt::
5757

5858
urls.py::
5959

60-
from django.conf.urls import patterns, include
60+
from django.conf.urls import include
6161

62-
urlpatterns = patterns('',
62+
urlpatterns = [
6363
url(r'^profile', include('robots.tests.urls_profile')),
64-
)
64+
]
6565

6666
urls_profile.py::
6767

68-
from django.conf.urls import patterns
69-
from robots.utils import url
68+
from url_robots.utils import url
7069

71-
urlpatterns = patterns('',
72-
url(r'^s$', 'view', name='profiles', robots_allow=True),
73-
url(r'^/(?P<nick>\w+)$', 'view'),
74-
url(r'^/(?P<nick>\w+)/private', 'view', name='profile_private', robots_allow=False),
75-
url(r'^/(?P<nick>\w+)/public', 'view', name='profile_public', robots_allow=True),
76-
)
70+
urlpatterns = [
71+
url(r'^s$', views.some_view, name='profiles', robots_allow=True),
72+
url(r'^/(?P<nick>\w+)$', views.some_view),
73+
url(r'^/(?P<nick>\w+)/private', views.some_view, name='profile_private', robots_allow=False),
74+
url(r'^/(?P<nick>\w+)/public', views.some_view, name='profile_public', robots_allow=True),
75+
]
7776

7877
Resulting robots.txt::
7978

0 commit comments

Comments
 (0)