Django Form not showing up

I have edited everything but for some reason when I open the page my form is not showing up

views.py

def order_view(request):
    form = forms.FormName()
    return render(request, 'homeland/property-details.html', {'form': form})

forms.py

class FormName(forms.Form):
    name = forms.CharField()
    email = forms.EmailField()
    text = forms.CharField(widget=forms.Textarea)

html

  <h3 class="h4 text-black widget-title mb-3">Order your item here</h3>
              <form  method="post" class="form-contact-agent">
                    {{ form.as_p }}
  <input type="submit"  class="btn btn-primary" value="Send Message">
              </form>
            </div>

Unfortunately, your code and form formatting is lost when you paste it as text.

Please enclose your snippets between lines of three ` (backtick) characters:

For example

def order_view(request):
    form = forms.FormName()
    return render(request, ‘homeland/property-details.html’, {‘form’: form})```

Thanks a lot, appreciate the help

Please be more specific. What is happening? Are you getting an error message in the browser? Is the page displaying but not the form? Is there any error on the console where you’re running it?

I have the page as usual but the form itself is not showing, i have no errors and {{ form }} is recognized by the html I’m getting everything as the way they should be but the area where the form is supposed to be is empty

I was able run what you’ve posted here. That implies to me that the error is not within the areas shown.
I’m guessing there’s more to the property-details.html file than what you’ve shown - it’s possible that you have an error in the surrounding template that is masking the issue.

  • You could try trimming your template down to what you have here.
  • You could also use the browser’s developer tools to look at the loaded page to see if the form was rendered at all, and just not being displayed.
  • You might also want to look at the CSS being applied to make sure there isn’t something really strange happening there.