Adding an article search engine
Offering visitors pagination is a good idea to optimize resources and offer controlled navigation. In addition, including a search engine for articles will provide complete exploration. That is why we are going to integrate a text field to find articles by title.
In app/website/forms.py
, we incorporate the following form, which will only have one field:
from django import forms from . models import Comment class SearchForm(forms.Form): search = forms.CharField( label="Search", max_length=255, required=False, widget=forms.TextInput( attrs={ "id":...