generated from aboutcode-org/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add captcha challenge on admin login page
Signed-off-by: Keshav Priyadarshi <[email protected]>
- Loading branch information
1 parent
c7a2630
commit b79876a
Showing
5 changed files
with
86 additions
and
3 deletions.
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,66 @@ | ||
{% extends "admin/base_site.html" %} | ||
{% load i18n static %} | ||
|
||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/login.css" %}"> | ||
{{ form.media }} | ||
{% endblock %} | ||
|
||
{% block bodyclass %}{{ block.super }} login{% endblock %} | ||
|
||
{% block usertools %}{% endblock %} | ||
|
||
{% block nav-global %}{% endblock %} | ||
|
||
{% block nav-sidebar %}{% endblock %} | ||
|
||
{% block content_title %}{% endblock %} | ||
|
||
{% block nav-breadcrumbs %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
{% if form.errors %} | ||
{% for error in form.errors.values %} | ||
<p>{{ error }}</p> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
|
||
<div id="content-main"> | ||
|
||
{% if user.is_authenticated %} | ||
<p class="errornote"> | ||
{% blocktranslate trimmed %} | ||
You are authenticated as {{ username }}, but are not authorized to | ||
access this page. Would you like to login to a different account? | ||
{% endblocktranslate %} | ||
</p> | ||
{% endif %} | ||
|
||
<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %} | ||
<div class="form-row"> | ||
{{ form.username.errors }} | ||
{{ form.username.label_tag }} {{ form.username }} | ||
</div> | ||
<div class="form-row"> | ||
{{ form.password.errors }} | ||
{{ form.password.label_tag }} {{ form.password }} | ||
<input type="hidden" name="next" value="{{ next }}"> | ||
</div> | ||
{% url 'admin_password_reset' as password_reset_url %} | ||
{% if password_reset_url %} | ||
<div class="password-reset-link"> | ||
<a href="{{ password_reset_url }}">{% translate 'Forgotten your password or username?' %}</a> | ||
</div> | ||
{% endif %} | ||
<div class="field"> | ||
<div class="control"> | ||
{{ form.captcha }} | ||
</div> | ||
</div> | ||
<div class="submit-row"> | ||
<input type="submit" value="{% translate 'Log in' %}"> | ||
</div> | ||
</form> | ||
</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