Skip to content

Commit

Permalink
Password Reset
Browse files Browse the repository at this point in the history
  • Loading branch information
pkelly55 committed Feb 22, 2024
1 parent 9f03b4d commit c94246e
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 3 deletions.
Binary file removed .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store



Admin/__pycache__/
# git ignore virt env

# ignore media files
Expand Down
Binary file removed Admin/.DS_Store
Binary file not shown.
Binary file modified Admin/Admin/__pycache__/settings.cpython-39.pyc
Binary file not shown.
10 changes: 10 additions & 0 deletions Admin/Admin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,13 @@
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"


# Email settings
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = "smtp.gmail.com"
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'ocsobosrmbgljcun'

Binary file modified Admin/db.sqlite3
Binary file not shown.
Binary file removed Admin/media/.DS_Store
Binary file not shown.
Binary file removed Admin/website/.DS_Store
Binary file not shown.
Binary file modified Admin/website/__pycache__/urls.cpython-39.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions Admin/website/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ <h1>LOGIN: </h1>
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-secondary">Login</button>
<a href="{% url 'password_reset' %}" class="btn btn-primary">Forgot Password?</a>



Expand Down
7 changes: 7 additions & 0 deletions Admin/website/templates/password_reset_complete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block title %}Password Reset{% endblock %}
{% block content %}
<p>Your password has been reset. Go login with your new password
<a href="{% url 'home' %}">home</a>
</p>
{% endblock %}
13 changes: 13 additions & 0 deletions Admin/website/templates/password_reset_confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends 'base.html' %}
{% block content %}
{% if validlink %}
<h3> Change Password </h3>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Change Password</button>
</form>
{% else %}
<p> The password reset link was invalid, possibly because it has already been used. Please request a new password reset. </p>
{% endif %}
{% endblock %}
7 changes: 7 additions & 0 deletions Admin/website/templates/password_reset_done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block title %}Password Reset{% endblock %}
{% block content %}
<p> We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly. </p>

<p> If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder. </p>
{% endblock %}
12 changes: 12 additions & 0 deletions Admin/website/templates/password_reset_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends 'base.html' %}
{% block title %}Password Reset{% endblock %}
{% block content %}
<div class="col-md-6 offset-md-3">
<h1>Password Reset</h1>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Reset Password</button>
</form>
</div>
{% endblock %}
8 changes: 7 additions & 1 deletion Admin/website/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views


urlpatterns = [
path("", views.home, name="home"),
Expand All @@ -13,6 +15,10 @@
path("edit_record/<int:pk>", views.edit_record, name="edit_record"),
# path("business_record/", views.B_record, name="B_record"),
path("upload/", views.upload, name="upload"),
path("monitor/", views.traffic_monitor, name="monitor")
path("monitor/", views.traffic_monitor, name="monitor"),
path("password_reset/",auth_views.PasswordResetView.as_view(template_name='password_reset_form.html'),name="password_reset"),
path("password_reset_done/",auth_views.PasswordResetDoneView.as_view(template_name='password_reset_done.html'),name="password_reset_done"),
path("password_reset_confirm/<uidb64>/<token>/",auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'),name="password_reset_confirm"),
path("password_reset_complete/",auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'),name="password_reset_complete"),

]
Binary file removed venv/.DS_Store
Binary file not shown.
Binary file removed venv/lib/python3.9/site-packages/.DS_Store
Binary file not shown.

0 comments on commit c94246e

Please sign in to comment.