Django uses Python's builtin logging module. For questions related to logging tasks in Django.
Questions tagged [django-logging]
96 questions
0
votes
1 answer
Understanding django's logging
I am a bit confused on how django is handling the logging. I have this setting for loggers in my settings:
Logging settings
LOGGING = {
...
'handlers': {
'console': {
'class': 'logging.StreamHandler',
…

dusual
- 2,097
- 3
- 19
- 26
0
votes
1 answer
Python logging works in shell, but not in views
I have been following the Django Logging docs but haven't been able to produce logs. All of this is within a virtualenv.
My views.py file contains
import logging
logger = logging.getLogger(__name__)
def index(request):
logger.debug('Index…

taintedromance
- 51
- 2
- 7
0
votes
1 answer
store data in the log files
I am using Django 1.8 for a project. I have kept the logs in the settings as :
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s…

the_unknown_spirit
- 2,518
- 7
- 34
- 56
0
votes
0 answers
Can't print log to the console
I'm using logging in my Django project.
If I set handlers to file, I can find logs in the file.
If I set handlers to console, there is nothing happened.
Here is the setting
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
…

Yuwen Yan
- 4,777
- 10
- 33
- 63
-2
votes
1 answer
how to redirect different login page according to type of users specified in django admin?
i created user -
user 1 assigned group A
user 2 assigned group B
now i created login page and after login as user1 i want to redirect to page1.html
and if logged in as user2 then redirect to page2.html
for this
i wrote
def login(request):
if…

ritu
- 43
- 1
- 8