Обратный вариант для 'google_login' не найден. 'google_login' не является допустимой функцией представления или именем шаблона
У меня есть проект, и я хочу использовать аутентификацию Google для регистрации на моем сайте.
Вот мой код signup.html:
{% load socialaccount %}
<form class="site-form" action="{% url 'authentication:signup' %}" method="post">
{{ form }}
{% csrf_token %}
<label>
<a href="{% provider_login_url "google" %}">Login With Google</a>
<input type="submit" value="submit">
</label>
</form>
и это мой urls.py файл:
path('signup/', views.signup_view, name='signup'),
path('google-login/', include('allauth.urls')),
но когда я хочу использовать из singup.html, возникает ошибка:
Reverse for 'google_login' not found. 'google_login' is not a valid view function or pattern name.
и когда я хочу использовать google-login, отображается 404 not found:
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:
admin/
auth/ login/ [name='login']
auth/ logout/ [name='logout']
auth/ signup/ [name='signup']
auth/ google-login/ signup/ [name='account_signup']
auth/ google-login/ login/ [name='account_login']
auth/ google-login/ logout/ [name='account_logout']
auth/ google-login/ password/change/ [name='account_change_password']
auth/ google-login/ password/set/ [name='account_set_password']
auth/ google-login/ inactive/ [name='account_inactive']
auth/ google-login/ email/ [name='account_email']
auth/ google-login/ confirm-email/ [name='account_email_verification_sent']
auth/ google-login/ ^confirm-email/(?P<key>[-:\w]+)/$ [name='account_confirm_email']
auth/ google-login/ password/reset/ [name='account_reset_password']
auth/ google-login/ password/reset/done/ [name='account_reset_password_done']
auth/ google-login/ ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key']
auth/ google-login/ password/reset/key/done/ [name='account_reset_password_from_key_done']
auth/ google-login/ social/
auth/ google-login/ google/
auth/ google-signup/
auth/ ^static/(?P<path>.*)$
The current path, auth/google-login/, didn’t match any of these.