This is driving me crazy.
Is there someone out there that can help?
Traceback (most recent call last):
File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 92, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/www/django_test1/omu2/views.py", line 26, in frontIndex
context_instance=RequestContext(request))
File "/opt/python2.6/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader.py", line 108, in render_to_string
return t.render(context_instance)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader_tags.py", line 97, in render
return compiled_parent.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader_tags.py", line 24, in render
result = self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 946, in render
autoescape=context.autoescape))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 243, in render
return self.nodelist_true.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 155, in render
nodelist.append(node.render(context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 826, in render
output = self.filter_expression.resolve(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 546, in resolve
obj = self.var.resolve(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 687, in resolve
value = self._resolve_lookup(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 716, in _resolve_lookup
current = getattr(current, bit)
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 94, in url
self._create()
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 54, in _create
if self._exists():
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 72, in _exists
return self._obj._storage.exists(self.name)
File "/opt/python2.6/lib/python2.6/site-packages/cumulus/storage.py", line 147, in exists
self._get_cloud_obj(name)
File "/opt/python2.6/lib/python2.6/site-packages/cumulus/storage.py", line 99, in _get_cloud_obj
return self.container.get_object(name)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/utils.py", line 43, in decorator
return f(*args, **kwargs)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/container.py", line 316, in get_object
return Object(self, object_name, force_exists=True)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/storage_object.py", line 89, in __init__
if not self._initialize() and force_exists:
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/storage_object.py", line 468, in _initialize
raise ResponseError(response.status, response.reason)
ResponseError: 401: Unauthorized
Ok, so I have done a bit of digging and fond that django-1.1.1, django-imagekit-0.3.3 and django-cumulus-0.3.3 or earlier versions don't play well together.
I upgraded to django-1.1.2 django-cumulus-0.3.4 and works fine now.
to do this do the following - pip install -r http://bitbucket.org/richleland/django-cumulus/raw/0.3.4/requirements.txt
Related
I have a django-cms 3.0.2 instance in production. Debug is off, apache configured, allowed_hosts set. I can browse the pages, log into admin etc. Everything works fine except one thing:
If I try inline editing (.../?edit) then I get a 500 Server Error.
Apache Error log is silent. My logger give me the following error:
Traceback (most recent call last):
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 137, in get_response
response = response.render()
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/response.py", line 105, in render
self.content = self.rendered_content
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/response.py", line 82, in rendered_content
content = template.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/loader_tags.py", line 123, in render
return compiled_parent._render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/classytags/core.py", line 106, in render
return self.render_tag(context, **kwargs)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py", line 76, in render_tag
rendered_contents = nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/classytags/core.py", line 106, in render
return self.render_tag(context, **kwargs)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com/cms/templatetags/cms_tags.py", line 632, in render_tag
content = render_to_string('cms/toolbar/toolbar.html', context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/loader.py", line 164, in render_to_string
return t.render(Context(dictionary))
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/templatetags/i18n.py", line 171, in render
output = self.nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/defaulttags.py", line 203, in render
nodelist.append(node.render(context))
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/loader_tags.py", line 155, in render
return self.render_template(self.template, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/loader_tags.py", line 137, in render_template
output = template.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/templatetags/i18n.py", line 171, in render
output = self.nodelist.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 897, in render
return render_value_in_context(output, context)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/template/base.py", line 875, in render_value_in_context
value = force_text(value)
File "/source/ComGo/comgo_regional_de_com/comgo_regional_de_com_venv/lib/python2.7/site-packages/django/utils/encoding.py", line 116, in force_text
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 12: ordinal not in range(128). You passed in <django.utils.functional.__proxy__ object at 0xa795930c> (<class 'django.utils.functional.__proxy__'>)
However if I temporarily turn on debug, then I can edit as well.
So whats going wrong? Any ideas?
When setting up the Django admin site, I get the following error. I am having a hard time debugging it because I can't tell where in my 'Announcement' model the problem is occurring. I've checked base.py on the line where the problem occurs, but I don't really understand all of what is going on in that class.
Internal Server Error: /admin/main/announcment/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 140, in get_response
response = response.render()
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py", line 105, in render
self.content = self.rendered_content
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py", line 82, in rendered_content
content = template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 124, in render
return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 124, in render
return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 63, in render
result = block.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 63, in render
result = block.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 1185, in render
_dict = func(*resolved_args, **resolved_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 286, in result_list
'results': list(results(cl))}
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 264, in results
yield ResultList(None, items_for_result(cl, res, None))
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 256, in __init__
super(ResultList, self).__init__(*items)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 184, in items_for_result
f, attr, value = lookup_field(field_name, result, cl.model_admin)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/util.py", line 258, in lookup_field
value = attr()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 433, in __str__
return force_text(self).encode('utf-8')
AttributeError: 'datetime.datetime' object has no attribute 'encode'
Without seeing your Annoucement model, it's hard to tell, but it seems probable that you are returning a datetime from your __unicode__ method, instead of an actual unicode string.
Pretty simple code but a weird situation...
have a template with this snippet:
{% is_contest story as iscontest %}
where is_contest is this custom template tag:
#register.assignment_tag
def is_contest(obj):
contesttype = ContentType.objects.get_for_model(Contest)
return obj.source_content_type == contesttype
But Contest is in the django_content_type table.
Weirdest part: This is only an intermittent error, and only seems to be caused by the template tag (I do this check in views too but no errors there).
Any ideas?
EDIT: Full Traceback
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/src/cbframe/commentableobjects/views/commentableobject_list.py", line 142, in commentablobject_list
return render_to_response('commentableobjects-list.html', info, context_instance=RequestContext(request))
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 176, in render_to_string
return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 123, in render
return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 281, in render
return nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 155, in render
return self.render_template(self.template, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 137, in render_template
output = template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 185, in render
nodelist.append(node.render(context))
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 1139, in render
context[self.target_var] = func(*resolved_args, **resolved_kwargs)
File "/home/ubuntu/src/cbframe/commentableobjects/templatetags/url_target_blank.py", line 27, in is_contest
return obj.source_content_type == contesttype
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/related.py", line 350, in __get__
rel_obj = qs.get(**params)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 366, in get
% self.model._meta.object_name)
DoesNotExist: ContentType matching query does not exist.
One problem might be that you are comparing 2 instances with eachother, while these should be the same in Django since Django caches them, that is not a guarantee.
Not sure how/where the source_content_type comes from, but I would recommend this instead:
return isinstance(obj, contesttype)
As for the original problem, do you have a stacktrace? This error seems a bit strange.
Are you sure that Contest isn't being overwritten somewhere in the scope?
Contest could be overwritten by other code in the module, the most likely suspect in that case would be a global Contest but that doesn't appear to be the case here.
[edit]
Thanks to the stacktrace the problem is a bit clearer.
This part specifically shows that it's going wrong in the obj.source_content_type part:
return obj.source_content_type == contesttype
I think that some object doesn't have an existing source_content_type anymore.
I am using django-haystack and Whoosh on my Ubuntu server and finding that certain search queries just raise an error page, and I have no idea why this is happening...
I am using the following ones
Whoosh==2.4.0
django-haystack==1.2.7
And I also run python manage.py update_index once every hour
Example traceback
Traceback (most recent call last):
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/hooks/framework_django.py", line 430, in __call__
return self.__wrapped(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/haystack/views.py", line 50, in __call__
return self.create_response()
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/haystack/views.py", line 145, in create_response
return render_to_response(self.template, context, context_instance=self.context_class(self.request))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/loader.py", line 188, in render_to_string
return t.render(context_instance)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 123, in render
return self._render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/api/function_trace.py", line 82, in __call__
return self._nr_next_object(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
return compiled_parent._render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/api/function_trace.py", line 82, in __call__
return self._nr_next_object(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/hooks/framework_django.py", line 622, in __call__
return self.__wrapped(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 64, in render
result = block.nodelist.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 311, in render
return self.nodelist_true.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 227, in render
nodelist.append(node.render(context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 915, in render
resolved_vars = [var.resolve(context) for var in self.vars_to_resolve]
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 653, in resolve
value = self._resolve_lookup(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 692, in _resolve_lookup
raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [object] in u'None'
<WSGIRequest
GET:<QueryDict: {u'q': [u'stockholm']}>,
Could you please put here your view and your template code? If this is happening with just some queries and not all of them, it could be the parameters you are passing to the view.
Here's the code of the view I'm using to make search queries using Haystack 2.0 and Whoosh 2.3.2 in a project of my own:
def search(request):
sqs = SearchQuerySet().filter(content=AutoQuery(request.GET['q']))
return render_to_response('search.html', {'sqs': sqs,})
and this works perfectly fine. I guess you should consider using the latest version of Haystack, because I was experiencing a lot of bugs with the old stable ones. And I recommend you to use the "rebuild_index" once in a while too, just in case.
I seem to get this error, and don't know how to debug it.
Any pointers?
Traceback (most recent call last):
File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 92, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/www/django_test1/omu2/views.py", line 26, in frontIndex
context_instance=RequestContext(request))
File "/opt/python2.6/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader.py", line 108, in render_to_string
return t.render(context_instance)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader_tags.py", line 97, in render
return compiled_parent.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader_tags.py", line 24, in render
result = self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 946, in render
autoescape=context.autoescape))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 243, in render
return self.nodelist_true.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 155, in render
nodelist.append(node.render(context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 826, in render
output = self.filter_expression.resolve(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 546, in resolve
obj = self.var.resolve(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 687, in resolve
value = self._resolve_lookup(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 716, in _resolve_lookup
current = getattr(current, bit)
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 94, in url
self._create()
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 66, in _create
self._obj._storage.save(self.name, content)
File "/opt/python2.6/lib/python2.6/site-packages/django/core/files/storage.py", line 46, in save
name = self.get_available_name(name)
File "/opt/python2.6/lib/python2.6/site-packages/django/core/files/storage.py", line 71, in get_available_name
while self.exists(name):
File "/opt/python2.6/lib/python2.6/site-packages/cumulus/storage.py", line 147, in exists
self._get_cloud_obj(name)
File "/opt/python2.6/lib/python2.6/site-packages/cumulus/storage.py", line 99, in _get_cloud_obj
return self.container.get_object(name)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/utils.py", line 43, in decorator
return f(*args, **kwargs)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/container.py", line 316, in get_object
return Object(self, object_name, force_exists=True)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/storage_object.py", line 89, in __init__
if not self._initialize() and force_exists:
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/storage_object.py", line 462, in _initialize
'HEAD', [self.container.name, self.name]
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/connection.py", line 200, in make_request
response = retry_request()
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/connection.py", line 194, in retry_request
return self.connection.getresponse()
File "/opt/python2.6/lib/python2.6/httplib.py", line 974, in getresponse
response.begin()
File "/opt/python2.6/lib/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
File "/opt/python2.6/lib/python2.6/httplib.py", line 349, in _read_status
line = self.fp.readline()
File "/opt/python2.6/lib/python2.6/socket.py", line 397, in readline
data = recv(1)
File "/opt/python2.6/lib/python2.6/ssl.py", line 96, in <lambda>
self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen, flags)
File "/opt/python2.6/lib/python2.6/ssl.py", line 222, in recv
raise x
SSLError: The read operation timed out
I'm the author of django-cumulus. Cloud Files is notorious for SSL connection issues. django-cumulus has a setting (added in 0.3.6) called CUMULUS_TIMEOUT that defaults to 5 seconds. You can increase it to 10 or 15 to try and alleviate this.
See https://github.com/richleland/django-cumulus/issues/5 for more info and feel free to post an issue there if you continue to experience problems.
From the look of it I would say that the connection to Rackspace Cloudfiles timed out. Imagekit builds the thumbnails dynamically (which I believe it was doing here in _create()) but there is also an option to create all the thumbnails when the model is saved as opposed to while rendering. That won't really help you if Rackspace goes down but it will help lower the time it takes to render your templates.
EDIT:
To pre-cache your thumbnail you change your ImageSpec definition to include pre_cache = True such as (from the imagekit wiki):
from imagekit.specs import ImageSpec
class Thumbnail(ImageSpec):
access_as = 'thumbnail_image'
pre_cache = True
If you change your specs you can re-build all of the cached thumbnails with the ikflush management command. You should note that while this will create all the thumbnails where pre_cache = True this will also delete all the cached images where pre_cache = False.