hood/views.py
def search_posts(request):   
    '''
    view function that redirects to a search results page
    ''' 
    if 'post' in request.GET and request.GET['post']:
        search_term=request.GET.get('post')
        search_posts=Post.search(search_term)
        context={
            'message':f'{search_term}',
            'posts':search_posts
        }

        return render(request,'hood/search.html',context)
    else :
        return render(request,'hood/search.html')

    view function that redirects to a search results page
    
view function that redirects to a search results page
view function that redirects to a search results page
def search_posts(request):   
    if 'post' in request.GET and request.GET['post']:
        search_term=request.GET.get('post')
        search_posts=Post.search(search_term)
        context={
            'message':f'{search_term}',
            'posts':search_posts
        }
        return render(request,'hood/search.html',context)
    else :
        return render(request,'hood/search.html')
def search_posts ( request ) : if 'post' in request . GET and request . GET [ 'post' ] : search_term = request . GET . get ( 'post' ) search_posts = Post . search ( search_term ) context = { 'message' : f'{search_term}' , 'posts' : search_posts } return render ( request , 'hood/search.html' , context ) else : return render ( request , 'hood/search.html' )
view function that redirects to a search results page
view function that redirects to a search results page
'''
    view function that redirects to a search results page
    '''
request