neighbourhood/views.py
def profile(request):
    """Function for displaying  User Profile Details"""

    user = request.user

    posts = Post.objects.filter(posted_by = profile).all()
    businesses = Business.objects.filter(owner = user).all()

    title = f'{request.user.username}\'s Profile'

    profileupdate = ProfileUpdateForm()
    businessupdate = BusinessForm()

    if request.method == 'POST':
        businessupdate = BusinessForm(request.POST, request.FILES)
        if businessupdate.is_valid():
            business = businessupdate.save(commit=False)
            business.manager = user
            business.save()
            return redirect('profile_UPDATE')
        else:
            businessupdate = BusinessForm()

    return render(request, 'profile_update.html', {'title':title, 'profile':profile, 'posts':posts, 'profileupdate':profileupdate, 'businessupdate':businessupdate, 'businesses':businesses})
Function for displaying  User Profile Details
Function for displaying  User Profile Details
Function for displaying User Profile Details
def profile(request):
    user = request.user
    posts = Post.objects.filter(posted_by = profile).all()
    businesses = Business.objects.filter(owner = user).all()
    title = f'{request.user.username}\'s Profile'
    profileupdate = ProfileUpdateForm()
    businessupdate = BusinessForm()
    if request.method == 'POST':
        businessupdate = BusinessForm(request.POST, request.FILES)
        if businessupdate.is_valid():
            business = businessupdate.save(commit=False)
            business.manager = user
            business.save()
            return redirect('profile_UPDATE')
        else:
            businessupdate = BusinessForm()
    return render(request, 'profile_update.html', {'title':title, 'profile':profile, 'posts':posts, 'profileupdate':profileupdate, 'businessupdate':businessupdate, 'businesses':businesses})
def profile ( request ) : user = request . user posts = Post . objects . filter ( posted_by = profile ) . all ( ) businesses = Business . objects . filter ( owner = user ) . all ( ) title = f'{request.user.username}\'s Profile' profileupdate = ProfileUpdateForm ( ) businessupdate = BusinessForm ( ) if request . method == 'POST' : businessupdate = BusinessForm ( request . POST , request . FILES ) if businessupdate . is_valid ( ) : business = businessupdate . save ( commit = False ) business . manager = user business . save ( ) return redirect ( 'profile_UPDATE' ) else : businessupdate = BusinessForm ( ) return render ( request , 'profile_update.html' , { 'title' : title , 'profile' : profile , 'posts' : posts , 'profileupdate' : profileupdate , 'businessupdate' : businessupdate , 'businesses' : businesses } )
Function for displaying  User Profile Details
Function for displaying User Profile Details
"""Function for displaying  User Profile Details"""
request