[Answered ]-Page not found (404) in django project

1👍

I’m guessing that the error is in your register.html, where you are initializing your form:

<form action="register" method="POST">

the action attribute accepts a url not a string, change it to this:

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

or add a slash before register:

<form action="/register" method="POST">
👤SLDem

0👍

Of course there is no path http://127.0.0.1:8000/static/accounts/register.
so when you change http://127.0.0.1:8000/static/accounts/register to http://127.0.0.1:8000/accounts/register, it should work properly. that’s obvious. unless the path in your urls.py project be static/accounts/.

👤HONCHO

0👍

The way you generate URLs in the template seems off.

The static tag is used to include static assets (images, CSS, JavaScript) in your code:

{% static "some_app/some_file.css" %}

The url tag is used to generate an URL, basing on your Django application URL configuration:

{% url "app_prefix:name" %}
👤dotz

Leave a comment