Answer the question
In order to leave comments, you need to log in
Why does a 404 error appear?
Hello, please help me figure it out, I don’t understand why after logging in it doesn’t go to the home page (index), but a 404 error appears.
If you need something else, please tell me about it.
urls.py users:
from django.urls import path, include
app_name = 'users'
urlpatterns = [
#включить url авторизации по умолчанию.
path('', include('django.contrib.auth.urls')),
]
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('users/', include('users.urls')),
path('', include('learning_logs.urls')),
]
{% extends "learning_logs/base.html" %}
{% block content %}
{% if form.errors %}
<p>Вы ввели неправильный логин или пароль, попробуйте еще раз.</p>
{% endif %}
<form method="post" action="{% url 'users:login'%}">
{% csrf_token %}
{{ form.as_p }}
<button name="submit">Войти</button>
<input type="hidden" name="next"
value="{% url 'learning_logs:index' %} /">
</form>
{% endblock content %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question