You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So i was getting a weird bug, the template would say:
"A server error occurred. Please contact the administrator."
And in the terminal (running the development server):
A big stack of errors (you know normal python error).
(i'll place the stack at the end of the issue).
Any way, problem appear when using the render_field tag:
If use alone with no attr (attr="value"), everything works perfectly.
But if you place any attr, it breaks.
Digging in i found the problem on widget_tweaks/templatetags/widget_tweaks.py (line 26, 31):
i simply commented those lines and everything works perfectly once again :)
# if not PY26:# # See https://bugs.python.org/issue1515.# # It is OK to not do it in Python 2.6 because# # Django versions which require deepcopy here (1.7+)# # don't support Python 2.6 anyways.# field = copy.deepcopy(field)
(doble comment :P)
So the comment says Django (1.7+), but i think there should be a second condition because it looks like in some newer version of Django, that statement stopped working.
My configuration:
virtualenv
Django 1.8.2
Python 2.7.6
Mac Os 10.10
widget_tweaks 1.4
Thanks for reading! 👍
Ok, terminal stack trace:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
return self.application(environ, start_response)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
response = self.get_response(request)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 261, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 97, in technical_500_response
html = reporter.get_traceback_html()
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 383, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 328, in get_traceback_data
frames = self.get_traceback_frames()
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 501, in get_traceback_frames
'vars': self.filter.get_traceback_frame_variables(self.request, tb.tb_frame),
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 234, in get_traceback_frame_variables
cleansed[name] = self.cleanse_special_types(request, value)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 191, in cleanse_special_types
value = self.get_request_repr(value)
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 122, in get_request_repr
return build_request_repr(request, POST_override=self.get_post_parameters(request))
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/views/debug.py", line 186, in get_post_parameters
return request.POST
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 137, in _get_post
self._load_post_and_files()
File "/Users/alejandro/Documents/pythonDev/seeds/env/lib/python2.7/site-packages/django/http/request.py", line 246, in _load_post_and_files
if self.method != 'POST':
AttributeError: 'WSGIRequest' object has no attribute 'method'
[29/Jun/2015 13:54:09]"GET / HTTP/1.1" 500 59
The text was updated successfully, but these errors were encountered:
So i was getting a weird bug, the template would say:
And in the terminal (running the development server):
Any way, problem appear when using the render_field tag:
Digging in i found the problem on
widget_tweaks/templatetags/widget_tweaks.py
(line 26, 31):(doble comment :P)
So the comment says Django (1.7+), but i think there should be a second condition because it looks like in some newer version of Django, that statement stopped working.
My configuration:
Thanks for reading! 👍
Ok, terminal stack trace:
The text was updated successfully, but these errors were encountered: