Add logging framework usage example

This commit is contained in:
Andrew Smirnov
2021-02-18 20:45:56 +03:00
parent 46dc0f6ab6
commit ca1fab09c9
2 changed files with 41 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ from django_registration.views import RegistrationView
from django.contrib.auth.decorators import login_required
from zenpy import Zenpy
import logging
class CustomRegistrationView(RegistrationView):
@@ -69,4 +69,6 @@ def profile_page(request):
def main_page(request):
logger = logging.getLogger('main.index')
logger.info('Index page opened')
return render(request, 'pages/index.html')