-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User Accounts with Signup/Login (Authentication)
- Loading branch information
1 parent
6109533
commit 6ab586e
Showing
5 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% extends "account/base.html" %} | ||
|
||
{% load i18n %} | ||
{% load account socialaccount %} | ||
|
||
{% block title %}{% trans "Sign In" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="container mt-5 mb-5"> | ||
<div class="row"> | ||
<div class="col-md-6 offset-md-3"> | ||
|
||
|
||
<h1>{% trans "Sign In" %}</h1> | ||
|
||
{% get_providers as socialaccount_providers %} | ||
|
||
{% if socialaccount_providers %} | ||
<p>{% blocktrans with site.name as site_name %}Please sign in with one | ||
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a> | ||
for a {{ site_name }} account and sign in below:{% endblocktrans %}</p> | ||
|
||
<div class="socialaccount_ballot"> | ||
|
||
<ul class="socialaccount_providers"> | ||
{% include "socialaccount/snippets/provider_list.html" with process="login" %} | ||
</ul> | ||
|
||
<div class="login-or">{% trans 'or' %}</div> | ||
|
||
</div> | ||
|
||
{% include "socialaccount/snippets/login_extra.html" %} | ||
|
||
{% else %} | ||
<p>{% blocktrans %}If you have not created an account yet, then please | ||
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p> | ||
{% endif %} | ||
|
||
<form class="login" method="POST" action="{% url 'account_login' %}"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
{% if redirect_field_value %} | ||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> | ||
{% endif %} | ||
|
||
<button class="btn btn-primary" type="submit">{% trans "Sign In" %}</button> | ||
|
||
<a class="btn btn-link" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a> | ||
|
||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ black==19.3b0 | |
flake8 | ||
isort | ||
wagtail-django-recaptcha==1.0 | ||
django-allauth==0.40.0 |
6ab586e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YouTube Video: https://www.youtube.com/watch?v=2QLAc7RJ99s&list=PLMQHMcNi6ocsS8Bfnuy_IDgJ4bHRRrvub&index=55
Written Tutorial: https://learnwagtail.com/tutorials/adding-user-authentication-registration-and-login-your-wagtail-website/