0

I'm trying to integrate Django's comment app into my site but with no success. I've been following the documentation outlined at: Django comments

The error I'm getting is:

Caught ViewDoesNotExist while rendering: Tried search in module FrontEnd.views. Error was: 'module' object has no attribute 'search'

nothing in my views refers to anything involving search. Something in the comments install is causing this. The line that actually fails is.

<form action="{% comment_form_target %}" method="post">

comment_form_target is highlighted.

The code causing the error:

{% load comments %}
{% get_comment_form for article as form %}
<form action="{% comment_form_target %}" method="post">
    {{ form }}
</form>

From what I've found online, it looks like i'm either missing some library in my Python 2.7 or i'm doing circular imports?

Paul Fleming
  • 24,238
  • 8
  • 76
  • 113
Valchris
  • 1,451
  • 2
  • 14
  • 33
  • That error occurs when you're trying to access a view that doesn't exist. What url are you using to access the page and what is the associated view show in urls.py? – Bryce Siedschlaw May 19 '11 at 13:39
  • The view without this block of code works fine. With this block it causes the error – Valchris May 19 '11 at 13:41
  • Hmm.. not sure what the problem is. Can you try creating a search view in your FrontEnd.views.py file? Just to see what it's expecting? – Bryce Siedschlaw May 19 '11 at 13:54
  • Thanks, don't know why I didn't think of that but it exposed the red herring. I was using Haystack search and "uninstalled" (clearly I missed something!) and thats whats causing the problems. Appreciated. – Valchris May 19 '11 at 13:57
  • Yay! :P Glad you got it figured out – Bryce Siedschlaw May 19 '11 at 13:59

1 Answers1

1

Add a search view in FrontEnd.views.py and see what the problem is.

I'm adding an answer so we can nicely close this ticket.

An error of the form

Tried test in module appname.views. Error was: 'module' object has no attribute 'search'

is generated when django tries to do reverse url lookups and the urls.py file contains a broken view.

Paul Fleming
  • 24,238
  • 8
  • 76
  • 113
Bryce Siedschlaw
  • 4,136
  • 1
  • 24
  • 36