[Answered ]-Page not found 404 with Django

2👍

Function render() takes template_name as argument.
Try to change return in Birth CertificateForm() to this:

return render(request, 'birthform.html', locals())

EDIT:

Probably you have problem in this line of code:

form = BirthCertificateForm()

I suggest you yo change view and to use following pattern:

form = BirthCertificateForm(request.POST or None)
if form.is_valid():
    numero_acte = form.cleaned_data["Numero de l'acte"]
    nom = form.cleaned_data['Nom']
    prenom = form.cleaned_data['Prenom']

and now you dont need this if-else validation:

if request.method == 'POST' :
    pass
else:
    pass

Leave a comment