import logging

from django.shortcuts import render

from posts.models import Post

logger = logging.getLogger(__name__)


def index_view(request):
    search = request.GET.get("search")

    posts = Post.objects.all()
    if search is not None:
        posts = posts.filter(title__icontains=search)

    return render(request, "posts/list.html", {"posts": posts})
5b9e2b4fd99f3e20dbeb232e1146f7f8b0119f9d
<mask token>

<mask token>


def index_view(request):
    search = request.GET.get('search')
    posts = Post.objects.all()
    if search is not None:
        posts = posts.filter(title__icontains=search)
    return render(request, 'posts/list.html', {'posts': posts})

<mask token>
logger = logging.getLogger(__name__)


def index_view(request):
    search = request.GET.get('search')
    posts = Post.objects.all()
    if search is not None:
        posts = posts.filter(title__icontains=search)
    return render(request, 'posts/list.html', {'posts': posts})

import logging
from django.shortcuts import render
from posts.models import Post
logger = logging.getLogger(__name__)


def index_view(request):
    search = request.GET.get('search')
    posts = Post.objects.all()
    if search is not None:
        posts = posts.filter(title__icontains=search)
    return render(request, 'posts/list.html', {'posts': posts})

import logging

from django.shortcuts import render

from posts.models import Post

logger = logging.getLogger(__name__)


def index_view(request):
    search = request.GET.get("search")

    posts = Post.objects.all()
    if search is not None:
        posts = posts.filter(title__icontains=search)

    return render(request, "posts/list.html", {"posts": posts})