easy signal registration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import logging

from importlib import import_module

from django.conf import settings

print logging, logging.__name__

logger = logging.getLogger(__name__)

signal_modules = {}

for app in settings.INSTALLED_APPS:
    signals_module = '%s.signals' % app
    try:
        signal_modules[app] = import_module(signals_module)
    except ImportError as e:
        logger.warning(
            'failed to import "%s", reason: %s' % (signals_module, str(e)))

More like this

  1. login on activation with django-registration by morgan 4 years, 1 month ago
  2. immitating 'real' post_syncdb signal by jango 4 years ago
  3. Show logged users - keeping track of users login and logout by albertorcf 1 year, 7 months ago
  4. Use crypt instead of sha1 as password hash algorithm by akaihola 6 years, 8 months ago
  5. Django Registration with GMail account by btbytes 7 years ago

Comments

aisbaa (on October 5, 2011):

sry left prin by mistake XD,, can edit this snippet ?

#

(Forgotten your password?)