Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
Added a setting NEXUS_SKIP_INSTALLED_APPS_REQUIREMENTS that allows yo…
Browse files Browse the repository at this point in the history
…u to have an app using nexus that doesn't use django.contrib.auth or django.contrib.sessions.
  • Loading branch information
Michael Scheibe committed May 15, 2012
1 parent d1f3771 commit 611299e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Now you'll want to include it within your ``urls.py``::
('^nexus/', include(nexus.site.urls)), ('^nexus/', include(nexus.site.urls)),
) )


By default Nexus requires django.contrib.auth and django.contrib.sessions. If you are using a custom auth system you can skip these requirements by using the setting ``NEXUS_SKIP_INSTALLED_APPS_REQUIREMENTS = True`` in your django settings.

Modules Modules
======= =======


Expand Down
2 changes: 2 additions & 0 deletions nexus/models.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured


_reqs = ('django.contrib.auth', 'django.contrib.sessions') _reqs = ('django.contrib.auth', 'django.contrib.sessions')
if getattr(settings, 'NEXUS_SKIP_INSTALLED_APPS_REQUIREMENTS', False):
_reqs = ()
for r in _reqs: for r in _reqs:
if r not in settings.INSTALLED_APPS: if r not in settings.INSTALLED_APPS:
raise ImproperlyConfigured("Put '%s' in your " raise ImproperlyConfigured("Put '%s' in your "
Expand Down

0 comments on commit 611299e

Please sign in to comment.