django-authority/docs/configuration.txt
2009-07-17 11:29:53 +02:00

62 lines
No EOL
1.6 KiB
Text

.. _configuration:
=============
Configuration
=============
.. index::
single: urls.py
single: settings.py
single: autodiscover
settings.py
===========
To enable django-authority you just need to add the package to your
``INSTALLED_APPS`` setting within your ``settings.py``::
# settings.py
INSTALLED_APPS = (
...
'authority',
)
Make sure your ``settings.py`` contains the following settings to enable the
context processors::
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
)
urls.py
=======
You also have to modify your root URLConf (e.g. ``urls.py``) to include the
app's URL configuration and automatically discover all the permission
classes you defined::
import authority
authority.autodiscover()
urlpatterns += patterns('',
(r'^authority/', include('authority.urls')),
)
If you're using Django 1.1 and Django's admin interface, make sure you place
``authority.autodiscover()`` **before** ``admin.autodiscover()``::
authority.autodiscover()
admin.autodiscover()
This is because django-authority automatically adds a `site-wide action`_ to the
admin-site and it prevents errors if you later decide to remove this action.
See :ref:`handling-admin` how to remove the admin action.
That's all (for now).
.. _site-wide action: http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/