Logger creation simplified
This commit is contained in:
parent
6b55e81816
commit
c9532aaf37
@ -1,12 +1,9 @@
|
||||
import logging
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed
|
||||
from django.dispatch import receiver
|
||||
|
||||
try:
|
||||
from config import APP_NAME as ROOT_LOGGER_NAME
|
||||
except ImportError:
|
||||
ROOT_LOGGER_NAME = 'root'
|
||||
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
||||
logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
|
||||
|
||||
|
||||
@receiver(user_logged_in)
|
||||
|
6
views.py
6
views.py
@ -15,11 +15,7 @@ from themes import Context
|
||||
import users
|
||||
from users import parameter
|
||||
|
||||
try:
|
||||
from config import APP_NAME as ROOT_LOGGER_NAME
|
||||
except ImportError:
|
||||
ROOT_LOGGER_NAME = 'root'
|
||||
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
||||
logger = logging.getLogger(settings.ROOT_LOGGER_NAME).getChild(__name__)
|
||||
|
||||
|
||||
def password_recovery(request):
|
||||
|
Loading…
x
Reference in New Issue
Block a user