I just upgradated my django to 1.4. I am getting trouble with haystack app. Also, I tried to update haystack to last stable version but I still having problems. Does anyone had theses errors? How can I solve it?
I am getting the following errors.
When I access any page:
cannot import name MAX_SHOW_ALL_ALLOWED haystack\admin.py in <module>, line 2
and
# python manage.py rebuild_index
django.core.exceptions.ImproperlyConfigured: Error importing template source loader
django.template.loaders.app_directories.load_template_source:
"'module' object has no attri bute 'load_template_source'"
Thanks
there is a problem in haystack/admin.py file. Try to do the following:
MAX_SHOW_ALL_ALLOWED
before class SearchChangeList
add method:
def list_max_show_all(changelist):
"""
Returns the maximum amount of results a changelist can have for the
"Show all" link to be displayed in a manner compatible with both Django
1.4 and 1.3. See Django ticket #15997 for details.
"""
try:
# This import is available in Django 1.3 and below
from django.contrib.admin.views.main import MAX_SHOW_ALL_ALLOWED
return MAX_SHOW_ALL_ALLOWED
except ImportError:
return changelist.list_max_show_all
in SearchChangeList.get_results()
change can_show_all
to
can_show_all = result_count <= list_max_show_all(self)
Check this thread for more background info on the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With