SHOW_TOOLBAR_CALLBACK no longer supports lambda
See original GitHub issuein my setup i always have seperate dev settings and in those settings i enable debug toolbar for all requests. i’ve always done that with the following config
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': lambda request: True,
}
after updating my virtualenv this morning i started getting errors that i’ve tracked down to trying to run rsplit on func_path
line 45 of debu_toolbar/middleware.py:
mod_path, func_name = func_path.rsplit('.', 1)
it looks like the meaning of SHOW_TOOLBAR_CALLBACK may have changed to require a string and not support a callable. if that’s the case i’m not sure what the solution would be. i’d rather not have to define a function somewhere and point this at it just to return true. i’d prefer if SHOW_TOOLBAR_CALLBACK supported being presented a callable.
Issue Analytics
- State:
- Created 10 years ago
- Comments:22 (12 by maintainers)
Top Results From Across the Web
Tutorial: Creating a simple Lambda@Edge function
This tutorial shows you how to get started with Lambda@Edge by helping you create and add a sample Node.js function that runs in...
Read more >How to do callback in kivymd toolbar from the screen manager?
I've found working solution. Maybe it will be helpful for someone: /main.py class App(MDApp): kv_file = 'main.kv' if __name__ == '__main__': ...
Read more >Lambda Integration - AWS Workshop Studio
Click Build on the top right-hand corner so Amazon Lex registers the lambda function. Test the bot by clicking the right hand side...
Read more >Provide custom back navigation - Android Developers
To learn more about this upcoming feature, see the corresponding preview ... The callback can be enabled or disabled here or in the...
Read more >Configuration — Django Debug Toolbar 3.8.1 documentation
This is the dotted path to a function used for determining whether the toolbar should show or not. The default checks are that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

All Django settings have primitive values, to avoid the temptation to import stuff in settings. The Debug Toolbar follows this philosophy. I’m sorry that it makes your use case marginally less practical, but I still think it’s a good trade-off for the community at large.
I would suggest the following (untested) code:
I dont think developers being ignorant is a good reason to remove simplicity 😃