Comments (14)
There is a test case in my branch.
from django-debug-toolbar.
Wow, this bug is nasty. Took me days to figure out.
Breaking this down, something along these lines on line 32 is a little ugly but certainly works.
for k,v in self.view_kwargs.iteritems():
new_view_kwargs[str(k)] = str(v)
use the new_views_kwargs in the context
from django-debug-toolbar.
Just wanted to let you know that I stumbled upon the same problem. I passing a custom form to a view via urls.py.
I do not quite get this as it only occurs in the staging/testing enviroment (nginx with apache) not durring dev (local runserver).
Is there something I can do to help?
from django-debug-toolbar.
Ok, I am new in python,django & rosette stuff, but shouldn't it all be like that:
context['session'] = [(unicode(k), unicode(self.request.session.get(k))) for k in self.request.session.iterkeys()]
Then it would work with any encoding?
from django-debug-toolbar.
getting same error... Any fix?
from django-debug-toolbar.
Isn't the problem fixed? I've installed it using pip.
from django-debug-toolbar.
The following code in request_vars.py fixes this issue:
def content(self):
view_func = self.view_func
if not hasattr(self.view_func, '**name**'):
view_func = self.view_func.**class**
context = self.context.copy()
context.update({
'get': [(k, self.request.GET.getlist(k)) for k in self.request.GET],
'post': [(k, self.request.POST.getlist(k)) for k in self.request.POST],
'cookies': [(k, self.request.COOKIES.get(k)) for k in self.request.COOKIES],
'view_func': '%s.%s' % (view_func.__module__, view_func.__name__),
'view_args': self.view_args,
'view_kwargs': self.view_kwargs
})
if hasattr(self.request, 'session'):
context.update({
'session': [(k, self.request.session.get(k)) for k in self.request.session.iterkeys()]
})
return render_to_string('debug_toolbar/panels/request_vars.html', context)
from django-debug-toolbar.
jbeaurain's code doesn't fix it for me. However nickers' code does.
from django-debug-toolbar.
No activity in 2 years, is this still a problem?
from django-debug-toolbar.
I spend a few minutes attempting to reproduce this and didn't succeed. @kmike could you check if the issue still exists in master?
from django-debug-toolbar.
@aaugustin sorry, i'm taking a break from web development and checking if this issue exists in master will require me setting up a django project, figuring out again what was my issue, etc. Wow, this ticket is 4 years old - I didn't realize I'm using Python for so long :) The mentioned test case for reproducing this issue is here: kmike@69dfed1
from django-debug-toolbar.
Never mind, I was just asking in case it was faster for you than for me to reproduce.
from django-debug-toolbar.
Your test case passes on master.
For bonus points I'm going to commit the test case with an object whose repr contains non-ASCII characters rather than the Django Form class, but I confirmed the test passes with Form too.
from django-debug-toolbar.
Just to be clear, the test validates that this object doesn't crash the request vars panel:
>>> from tests.models import NonAsciiRepr
>>> unicode(NonAsciiRepr())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
>>> str(NonAsciiRepr())
'n\xc3\xb4t \xc3\xa5sc\xc3\xad\xc3\xac'
>>> NonAsciiRepr()
nôt åscíì
from django-debug-toolbar.
Related Issues (20)
- Error after update to 4.4.1 (debug_toolbar.E001) The Django Debug Toolbar can't be used with tests HOT 5
- Version 4.4.1 changes the look of DRF browsable API HOT 8
- Just Enabling Debug Toolbar as Middleware creates Delays of Several Seconds on each request HOT 14
- I can no longer use iptools.IpRangeList for INTERNAL_IPS HOT 5
- SVG definitions have width in rem which throws console errors HOT 5
- Time panel in Debug Toolbar not clickable due to missing <a> tag HOT 1
- There is a delay in response to requests. HOT 1
- Using the toolbar with Replit HOT 4
- Dark mode text needs higher contrast HOT 6
- AttributeError: This StreamingHttpResponse instance has no `content` attribute. Use `streaming_content` instead. HOT 5
- Jinja2 dependency breaks default install HOT 1
- KeyError: "alerts" in nav_subtitle if alerts stats not present HOT 1
- KeyError: "alerts" in nav_subtitle if alerts stats not present HOT 2
- Release 4.4.4 seems to require Jinja2 HOT 3
- What time measures the "domLoading" entry under the time panel? HOT 2
- Crash on non-text views
- History sidebar panel keeps loading infinitely? HOT 14
- ImportError in 4.4.6 release cannot import name '_HTML_TYPES' from 'debug_toolbar.middleware' HOT 2
- Recast sentence HOT 3
- Using DDT with DRF Simple JWT HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-debug-toolbar.