0

I want to upgrade django-haystack in my app from 2.4.1 to 2.5.0. On version 2.4.1 my code works fine. But when I installed verison 2.5.0 I get error when I start searching, for example: New york and I dont have any search results.

"GET /en/search?q=new%20york HTTP/1.1" 500 26693

Exception Value:    
'MainSearchView' object has no attribute 'context_class'
mark
  • 1,027
  • 2
  • 7
  • 7
  • Have you got a stacktrace? Without details of the error encountered it's impossible to say what may be wrong... – markwalker_ Jan 23 '17 at 12:01
  • @markwalker_ I have only this: `"GET /en/search?q=new%20york HTTP/1.1" 500 26693` website is working but I didn't get any results of searching with 2.5.0 or 2.6.0 version. On 2.4.1 working fine. I want to upgrade because in 2.5.0 they fixed bug. – mark Jan 23 '17 at 12:08
  • If that's in production, a 500 should trigger an email to your `ADMINS` setting; https://docs.djangoproject.com/en/1.10/howto/error-reporting/ There you'll get your stacktrace. Either that or your server error log will have info in, depending on how your server is configured. – markwalker_ Jan 23 '17 at 12:10
  • This is not production server, I'm working on this on my local machine. – mark Jan 23 '17 at 12:15
  • In that case you'll have the stacktrace in your console from where you're running the server. Are you running in debug mode? – markwalker_ Jan 23 '17 at 12:16
  • Please check my edit. – mark Jan 23 '17 at 12:31
  • Post your `MainSearchView`. I suspect that is your view for search, which doesn't implement `context_class()`. RTD; https://django-haystack.readthedocs.io/en/v2.5.0/views_and_forms.html#new-django-class-based-views – markwalker_ Jan 23 '17 at 12:32

0 Answers0