diff options
| author | Tom Christie | 2012-02-25 18:45:17 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-02-25 18:45:17 +0000 |
| commit | 1cde31c86d9423e9b7a7409c2ef2ba7c0500e47f (patch) | |
| tree | ea24bce0f24507aa43f408776ccf7324f204256d /docs | |
| parent | 5fd4c639d7c64572dd07dc31dcd627bed9469b05 (diff) | |
| download | django-rest-framework-1cde31c86d9423e9b7a7409c2ef2ba7c0500e47f.tar.bz2 | |
Massive merge
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. |
