Friday, December 9, 2022

Re: Server error no httpresponse implementing htmx active search

On December 9, 2022 12:10:23 PM CST, Brian <biscotty666@gmail.com> wrote:
>```
>ValueError: The view Striker.views.search_player didn't return an
>HttpResponse object. It returned None instead.
>```
>view.py
>```
>def search_player(request):
> print(request)
> search_text = request.POST.get("search")
> results = Player.objects.filter(name__icontains=search_text)
> context = {'results': results}
> return render(request, 'Striker/partials/player-search-results.html',
>context)
>```

I assume view.py is a typo and you really meant views.py above? If you've got both a view.py and a views.py maybe that's your issue.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/E0B4846A-7916-4C2B-A40A-2670A387DC74%40fattuba.com.

No comments:

Post a Comment