hello I've got when I open my site I've got "SyntaxError at / invalid syntax (views.py, line 78)"

It does not tell me which of my views has this problem. It is strange that there is no problem in http://127.0.0.1:8000/, but there is a problem in the host I bought. I have also talked to the support and they said that it is a python problem and you have to solve this problem with a python programmer
here is my project, accounts and blog app views:

from django.shortcuts import render,get_object_or_404,redirect
from blog.models import Post
from django.utils import timezone
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from blog.models import Comment
from blog.forms import CommentForm
from django.contrib import messages
from django.urls import reverse
from django.http import HttpResponseRedirect
# from django.contrib.auth.decorators import login_required
# Create your views here.
# @login_required
def blog_view(request,**kwargs):
    posts=Post.objects.filter(status=1,published_date__lte=timezone.now())
    if kwargs.get('cat_name')!=None:
        posts=posts.filter(category__name=kwargs['cat_name'])
    if kwargs.get('author_username')!=None:
        posts=posts.filter(author__username=kwargs['author_username'])
    if kwargs.get('tag_name')!=None:
        posts=posts.filter(tags__name__in=[kwargs['tag_name']])
        

    posts=Paginator(posts,4)
    try:
        page_number=request.GET.get('page')
        posts=posts.get_page(page_number)
    except PageNotAnInteger:
        posts=posts.get_page(1)
    except EmptyPage :
        posts=posts.get_page(1)

    
    # return render(request, 'blog/post_detail.html', {'post': post})
    # posts=Post.objects.filter(status=0)
    context={'posts':posts}
    return render(request,'blog/blog-home.html',context)
def blog_single(request,pid):
    if request.method=='POST':
        form =CommentForm(request.POST)
        if form.is_valid():
            form.save()
            messages.add_message(request,messages.SUCCESS,"your comment submited")
        else:
            messages.add_message(request,messages.ERROR,"your comment didnt submited")  
    post = get_object_or_404(Post,pk=pid,status=1,published_date__lte=timezone.now())
    post.counted_views += 1
    post.save()
    previous_post = Post.objects.filter(id__lt=pid,status=1,published_date__lte=timezone.now()).order_by('-id').first()
    next_post = Post.objects.filter(id__gt=pid,status=1,published_date__lte=timezone.now()).order_by('id').first()
    if not post.login_require:
        comments=Comment.objects.filter(post=post.id,approved=True).order_by('-created_date')
        form=CommentForm()
        context={'post':post,'previous_post': previous_post,'next_post': next_post,'comments':comments,'form':form}
        return render(request,'blog/blog-single.html',context)
    else:
        return HttpResponseRedirect(reverse('accounts:login'))
def test(request):
    # post=Post.objects.get(id=pid)
    # posts=Post.objects.all()
    # posts=Post.objects.filter(status=0)
    # post = get_object_or_404(Post,pk=pid)
    # context={'post':post}
    return render(request,'test.html')


def blog_category(request,cat_name):
    posts=Post.objects.filter(status=1)
    posts=posts.filter(category__name=cat_name)
    context={'posts':posts}
    return render(request,'blog/blog-home.html',context)

def blog_search(request):
    posts=Post.objects.filter(status=1,published_date__lte=timezone.now())

    # print(request.__dict__)
    if request.method=='GET':
        # print(request.GET.get('s'))
        if s:=request.GET.get('s'):                                  ***that's the line 78***
            posts=posts.filter(content__contains=s)
    #     print('get request')
    context={'posts':posts}
    return render(request,'blog/blog-home.html',context)

I know that’s lot but when I delete line 78 it gives me error at line 81 then 82 then 18 that’s very on nerve help me please.

Side note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of fixing your original post, please remember to do this in the future.)

If this is the line throwing the syntax error:

then my guess would be that you’re trying to run this on a system using a version of Python older than 3.8. (That’s when the := operator was introduced.)

Yes, this is a Python issue and not a Django issue. To fix this you either need to run this on a host running a version of Python at least as current as 3.8, or go through all your code to find everything that isn’t compatible with the version of Python you are using, and change it to work with that older version.

thanks alot for your fast answering but I’ve got this problem when I click save :

That’s something you need to resolve with your hosting provider, it is not a Django-related issue.

thank you for your big help now I know what should I do :heart: