DEV Community

Dhinesh Dev
Dhinesh Dev

Posted on

How to fix Page Not Found (404) error in django

Django v3.0

Hi, Im new to Django programming language, Now im developing a college project in django, When Im using forms to create login in POST method. If I put it on main page, It's working well. But when I put the forms into inside of another page (about.html) I got this error. I can't fix it. So guys Please help me..

https://stackoverflow.com/q/60006271/11665780

This is the link of my stack overflow post with my codes. Please DEV help me fix it.

Top comments (1)

Collapse
 
sepyrt profile image
Dimitris R

Hello,

Instead of hard-coding the URL in the form action, try using the url template tag:

<form action="{% url 'login' %}" method="POST">
...

This way you won't need to change all your template references should you decide to use a different path. More: docs.djangoproject.com/en/3.0/ref/...