Monday, July 28, 2014

Re: Django Search via Form Redirect to URL



On Monday, July 28, 2014 11:49:12 AM UTC-7, Branko Majic wrote:
I have tried hacking your code on top of one of my search pages, and
definitively managed to get it working once I added the name for the
input.

Without the name, the search view would otherwise just fall through and
I'd get something in the lines of the following error:

The view project.views.search didn't return an HttpResponse object.

I'd suggest maybe putting in a couple of debug print messages in your
view to figure out where your code ends-up in the end.

Best regards

--
Branko Majic

Ok I did what you said and played around for a while and got it working! Thanks! Another issue I had which I think was the main one (as well as the namespace in my input) was that I needed to change my action to link to a url which validated my search view. I ended up just using /beacon/search/search_query/ but anything instead of search_query would have worked. This way Django runs through the search view no matter what page you are on. Ironically changing that also implemented my search function on the whole site because the form is in my base.html .

Seriously thanks for the help dude!

-Conner DiPaolo 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3d0f0c9a-d4a0-44c7-b17b-62d974f5a7d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment