Permalink
Browse files

just use a setting for config

  • Loading branch information...
andymckay committed Dec 21, 2012
1 parent ee47926 commit 8f9f009f5b5401cd522ca4e4ba90b19cbc7b5565
Showing with 8 additions and 5 deletions.
  1. +2 −0 django_paranoia/__init__.py
  2. +3 −1 django_paranoia/configure.py
  3. +2 −3 docs/topics/overview.rst
  4. +1 −1 setup.py
@@ -0,0 +1,2 @@
+from configure import config
+config()
@@ -1,6 +1,7 @@
import logging
from threading import local
+from django.conf import settings
from django.utils.importlib import import_module
from signals import finished, process, warning
@@ -39,7 +40,8 @@ def process_signals(signal, **kw):
process.send(request=kw['request'], **data)
-def config(reporters, *args, **kw):
+def config(*args, **kw):
+ reporters = getattr(settings, 'DJANGO_PARANOIA_REPORTERS', [])
for reporter in reporters:
try:
to = import_module(reporter).report
View
@@ -23,10 +23,9 @@ Add in the middleware::
Hook up the reporters::
- from django_paranoia import configure
- configure.config([
+ DJANGO_PARANOIA_REPORTERS = [
'django_paranoia.reporters.log',
- ])
+ ]
Using
=====
View
@@ -3,7 +3,7 @@
setup(
name='django-paranoia',
- version='0.1.5',
+ version='0.1.6',
description='OWASP detection point reporting for Django',
long_description=open('README.rst').read(),
author='Andy McKay',

0 comments on commit 8f9f009

Please sign in to comment.