mbi/django-rosetta — pull request #19 by thomasw (2012-01-16 08:39:20+00:00)
Title: Adds a flag that allows users to disable authentication requirements

In our environment, we don't need or want the rosetta app to require authentication. This pull request allows a developer to disable authentication for rosetta by setting ROSETTA_REQUIRES_AUTH = False.

As an added bonus, this flag allows rosetta to be used on django apps that don't have a database. The session framework will just need to be configured to use a backend that isn't the default database backend and they should be all set.

Here's an example configuration:

# Rosetta needs the session framework, but there isn't a db, using files
SESSION_ENGINE = 'django.contrib.sessions.backends.file'

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
# We need an anonymous user object, because rosetta passed it around
'django.contrib.auth.middleware.AuthenticationMiddleware',
)

INSTALLED_APPS = (
# Rosetta needs the admin section's static assets. We list it here
# just so that the staticfiles app knows to grab them.
'django.contrib.sessions',
'django.contrib.admin',
'rosetta',
)