add option to use django-request for detailed logging of all requests#44
add option to use django-request for detailed logging of all requests#44
Conversation
|
This seems fairly complicated especially as it pushes quite some logic to the @barsch Any opinions/advice how this is usually handled with django? Otherwise I'd be fine with this. |
|
never needed that in my projects - maybe this helps: |
|
Different approach, not sure if it's less ugly. I don't care which way. |
commented, so deactivated by default but can be switched on in local_settings.py Tested it locally, works when activated before initial jane setup (migrations)
814f10b to
401b366
Compare
Codecov Report
@@ Coverage Diff @@
## master #44 +/- ##
==========================================
- Coverage 85.65% 85.38% -0.27%
==========================================
Files 56 56
Lines 3652 3667 +15
==========================================
+ Hits 3128 3131 +3
- Misses 524 536 +12
Continue to review full report at Codecov.
|
|
So, any objections to merging this @krischer? |
|
I kind of like the solution in the second comment of @barch s link: In def get_setting(setting):
import settings
return getattr(settings, setting)
INSTALLED_APPS = get_setting('INSTALLED_APPS') + ('debug_toolbar', )
MIDDLEWARE_CLASSES = get_setting('MIDDLEWARE_CLASSES') + ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INTERNAL_IPS = ('127.0.0.1',)This would remove any complexity in the default I'm not fully convinced this approach does not result in circular imports but if it works as advertised it might be a nice alternative. |
This adds a ways of adding additional apps and middleware through
local_settings.py, also being able to control position of additional middleware in the chain.django-requestis commented by default, so deactivated but can be switched on inlocal_settings.py.Tested it locally, works when activated before initial jane setup (before intial migrations).
Closes #41