Хотел сделать систему авторизации по тутору но не находит темплейт
Короче, штмл вот:
{% block content %}
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
{# Assumes you setup the password_reset view in your URLconf #}
<p><a href="{% url 'password_reset' %}">Lost password?</a></p>
{% endblock %}
Вот вывод строки
Internal Server Error: /accounts/login/
Traceback (most recent call last):
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/base.py", line 162, in _render
return self.nodelist.render(context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/loader_tags.py", line 127, in render
compiled_parent = self.get_parent(context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/loader_tags.py", line 124, in get_parent
return self.find_template(parent, context)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/loader_tags.py", line 103, in find_template
template, origin = context.template.engine.find_template(
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/engine.py", line 129, in find_template
raise TemplateDoesNotExist(name, tried=tried)
django.template.exceptions.TemplateDoesNotExist: base_.html
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/core/handlers/base.py", line 204, in _get_response
response = response.render()
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/response.py", line 105, in render
self.content = self.rendered_content
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/response.py", line 83, in rendered_content
return template.render(context, self._request)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/backends/django.py", line 63, in render
reraise(exc, self.backend)
File "/home/ilya/.local/share/virtualenvs/REST-rHq2j1uW/lib/python3.8/site-packages/django/template/backends/django.py", line 84, in reraise
raise new from exc
django.template.exceptions.TemplateDoesNotExist: base_.html
[14/Mar/2021 12:11:28] "GET /accounts/login/ HTTP/1.1" 500 133376
в командной строке не django.template.exceptions.TemplateDoesNotExist: base_.html а django.template.exceptions.TemplateDoesNotExist: base_generic.html
*Это не ответ
Ответы (1 шт):
Автор решения: Ярослав Могутов
→ Ссылка
Django по умолчанию ищет все html шаблоны в папке templates, проверь название папки если оно не такое как я указал, то переименуй.
