Contact Us Form not being visible on Home page

Hi, I am new to Django so sorry if it is a dumb question:

def contact_us(request):
    if request.method == 'POST':
        form = ContactForm(request.POST or None)
        if form.is_valid():
            sender_name = form.cleaned_data['name']
            sender_email = form.cleaned_data['email']
            message = "{0} has sent you a new message:\n\n{1}".format(sender_name, form.cleaned_data['message'])
            send_mail('New Enquiry', message, sender_email, [''])
            return HttpResponse('Thanks for contacting us!')
        form = ContactForm()

    return render(request, 'member/home.html/', {'form': form})

this is views py

 path('#contact-section/', views.contact_us, name='member-contact-us'),

this is URL #contact-section is the id in the home page

  <form method="post">
        {% csrf_token %}
        {{ form.as_p }}
        <input type="submit" value="Submit" />

this is my form part in my home html

when I create a separate /contact-us html it works, I just cant embed it into my home page,I think maybe the issue is with the URL path?

Can you be more specific as to what the problem is?
You’ve shown what you’ve done that works, but you haven’t shown what you’ve tried to do to embed it in your home page, nor did you specify what error you’re receiving or the behavior that is being displayed.

Hi Ken! Thanks for your reply but I have managed to figure it out myself! :slight_smile:

thanks again!