question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django Debug Toolbar messing with error console logging under runserver

See original GitHub issue

Hello. I’ve noticed that when I have Django Toolbar enabled I’m not getting error messages on the console from runserver under my development machine. Is this some kind of incompatibility between the two? (I’m creating this task because recently there was some work regarding logging here, but please let me know if this is a problem with django_toolbar package)

I was able to reproduce under a clean project, with only channels and debug_toolbar installed.

I’ve made a video to better demonstrate this. I intentionally put a non defined variable on the connect() method just to crash: https://streamable.com/veo2s

Here are my packages:

channels==2.1.5
daphne==2.2.3
Django==2.1.3

And my test project (a basic Django startapp): test.zip

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewgodwincommented, Nov 23, 2018

OK, I’m afraid I think this might be a django-debug-toolbar issue, not a Channels issue, sorry! If you can find something in Channels we can fix that would re-enable it then let me know, but it would appear to be on the other end - I suspect the disable_existing_loggers on the recent code snippet is what is “fixing” it there.

1reaction
bluesurfercommented, Nov 23, 2018

This is related with my issue #1177. I was getting so frustrated over this. Finally, I solved it by using the following LOGGING configuration:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'handlers': {
        'console': {
            'level': 'INFO',
            'class': 'logging.StreamHandler',
        }
    },
    'loggers': {
        'django': {},
    },
    'root': {
        'handlers': ['console', ],
        'level': 'INFO'
    },
}

But still I do not know exactly why it works 😃

Source: https://medium.com/@saulshanabrook/simple-django-logging-ffa74c9ca0fc

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to run server when django debug toolbar is enabled
We are handling a very large django codebase, we are using django debug toolbar, the problem is so weird, if I put DEBUG_TOOLBAR=True...
Read more >
Top 10 Mistakes That Django Developers Make - Toptal
In this tutorial, we will look at some common mistakes that are often made ... in production, hashed static files, integrated debug toolbar,...
Read more >
Installation — Django Debug Toolbar 3.8.1 documentation
Configure Internal IPs​​ The Debug Toolbar is shown only if your IP address is listed in Django's INTERNAL_IPS setting. This means that for...
Read more >
Getting Started Quickly With Django Logging - SentinelOne
The django.template logger handles errors related to the rendering of templates. Missing context variables will appear in the log as DEBUG ...
Read more >
django-admin - Utility script for the Django Web framework
django -admin dumpdata Outputs to standard output all data in the database ... Django from deleting the temporary debugging errors which may prevent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found