diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/setup.rst | 18 | ||||
| -rw-r--r-- | docs/index.rst | 6 |
2 files changed, 15 insertions, 9 deletions
diff --git a/docs/howto/setup.rst b/docs/howto/setup.rst index 0af1449c..081c6412 100644 --- a/docs/howto/setup.rst +++ b/docs/howto/setup.rst @@ -49,20 +49,20 @@ YAML YAML support is optional, and requires `PyYAML`_. - Login / Logout -------------- -Django REST framework includes login and logout views that are useful if -you're using the self-documenting API:: +Django REST framework includes login and logout views that are needed if +you're using the self-documenting API. + +Make sure you include the following in your `urlconf`:: - from django.conf.urls.defaults import patterns + from django.conf.urls.defaults import patterns, url - urlpatterns = patterns('djangorestframework.views', - # Add your resources here - (r'^accounts/login/$', 'api_login'), - (r'^accounts/logout/$', 'api_logout'), - ) + urlpatterns = patterns('', + ... + url(r'^restframework', include('djangorestframework.urls', namespace='djangorestframework')) + ) .. _django.contrib.staticfiles: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/ .. _django-staticfiles: http://pypi.python.org/pypi/django-staticfiles/ diff --git a/docs/index.rst b/docs/index.rst index b969c4a3..a6745fca 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -64,6 +64,12 @@ To add Django REST framework to a Django project: * Ensure that the ``djangorestframework`` directory is on your ``PYTHONPATH``. * Add ``djangorestframework`` to your ``INSTALLED_APPS``. +* Add the following to your URLconf. (To include the REST framework Login/Logout views.):: + + urlpatterns = patterns('', + ... + url(r'^restframework', include('djangorestframework.urls', namespace='djangorestframework')) + ) For more information on settings take a look at the :ref:`setup` section. |
