diff --git a/jobportal/settings.py b/jobportal/settings.py index 108d87b..cd93986 100644 --- a/jobportal/settings.py +++ b/jobportal/settings.py @@ -25,6 +25,9 @@ SECRET_KEY = 'pb8%7mc+4z9s^a&86z@lexwe14hdi*qz41#a0ehqd3*ht#qc9a' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +if DEBUG: + EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + ALLOWED_HOSTS = [] diff --git a/jobportal/urls.py b/jobportal/urls.py index 3ef1c28..0a05e85 100644 --- a/jobportal/urls.py +++ b/jobportal/urls.py @@ -7,4 +7,5 @@ urlpatterns = [ path('admin/', admin.site.urls), path('', include('jobs.urls')), path('users/', include('users.urls')), + path('users/', include('django.contrib.auth.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/templates/base.html b/templates/base.html index fc57aea..4c77849 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,7 +4,7 @@ - JobPortal + Job Portal @@ -57,7 +57,7 @@ You have {{ user.count_unread_messages }} message(s) My wish list Update profile - Change password + Change password Logout @@ -73,7 +73,7 @@ {% if user.get_profile_id %} Update profile {% endif %} - Change password + Change password Logout diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html new file mode 100644 index 0000000..1e409f2 --- /dev/null +++ b/templates/registration/password_change_done.html @@ -0,0 +1,30 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} + +
+
+
+
+ +

Password changed

+
+
+
+
+ +
+
+
+ +
+ {% if user.is_authenticated %} +

Your password has been changed.

+ {% endif %} +
+ +
+
+
+ + {% endblock %} \ No newline at end of file diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html new file mode 100644 index 0000000..2fb0687 --- /dev/null +++ b/templates/registration/password_change_form.html @@ -0,0 +1,72 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} + +
+
+
+
+ +

Change password

+
+
+
+
+ +
+
+
+ +
+ {% if user.is_authenticated %} +
+ {% csrf_token %} + {% if form.errors %} + + {% endif %} +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+
+ {% endif %} +
+ +
+
+
+ + {% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..50d6446 --- /dev/null +++ b/templates/registration/password_reset_complete.html @@ -0,0 +1,26 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} + +
+
+
+
+ +

Message

+
+
+
+
+ +
+
+
+
+

Your password has been updated.

+
+
+
+
+ + {% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..38b663e --- /dev/null +++ b/templates/registration/password_reset_confirm.html @@ -0,0 +1,68 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} + +
+
+
+
+ +

Set new password

+
+
+
+
+ +
+
+
+
+ {% if validlink %} +
+ {% csrf_token %} + {% if form.errors %} + + {% endif %} + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+
+ {% else %} +

Your token is invalid.

+ {% endif %} +
+ +
+
+
+ + {% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_done.html b/templates/registration/password_reset_done.html new file mode 100644 index 0000000..f5c169a --- /dev/null +++ b/templates/registration/password_reset_done.html @@ -0,0 +1,27 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} + +
+
+
+
+ +

Message

+
+
+
+
+ +
+
+
+
+

We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.

+

If you don’t receive an email, please make sure you’ve entered the address you registered with, and check your spam folder.

+
+
+
+
+ + {% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_email.html b/templates/registration/password_reset_email.html new file mode 100644 index 0000000..61fba5c --- /dev/null +++ b/templates/registration/password_reset_email.html @@ -0,0 +1,2 @@ +Someone asked for password reset for email {{ email }}. Follow the link below: +{{ protocol}}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} \ No newline at end of file diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html new file mode 100644 index 0000000..418e0d9 --- /dev/null +++ b/templates/registration/password_reset_form.html @@ -0,0 +1,56 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} + +
+
+
+
+ +

Remind password

+
+
+
+
+ +
+
+
+ +
+
+ {% csrf_token %} + {% if form.errors %} + + {% endif %} +
+
+ + +
+
+ +
+
+ +
+
+
+
+ +
+
+
+ + {% endblock %} \ No newline at end of file diff --git a/templates/users/login.html b/templates/users/login.html index 163b6e9..a8bde86 100644 --- a/templates/users/login.html +++ b/templates/users/login.html @@ -47,6 +47,8 @@
+ +
@@ -60,26 +62,6 @@ {% endif %} -
-
-

Contact Info

-

Address

-

203 Fake St. Mountain View, San Francisco, California, USA

- -

Phone

-

+1 232 3235 324

- -

Email Address

-

[email protected]

- -
- -
-

More Info

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa ad iure porro mollitia architecto hic consequuntur. Distinctio nisi perferendis dolore, ipsa consectetur

-

Learn More

-
-
diff --git a/users/urls.py b/users/urls.py index 722406c..e76c879 100644 --- a/users/urls.py +++ b/users/urls.py @@ -1,11 +1,14 @@ from django.urls import path from .views import * +from django.contrib.auth import views as authViews app_name = "users" urlpatterns = [ path('register/', UserRegisterView.as_view(), name='register'), path('login/', UserLoginView.as_view(), name='login'), path('logout/', UserLogoutView.as_view(), name='logout'), + path('password-change/', authViews.PasswordChangeView.as_view(), name='password_change'), + path('password-change-done/', authViews.PasswordChangeDoneView.as_view(), name='password_change_done'), path('update-profile//', UserUpdateView.as_view(), name='update_profile'), path('employee-profile///', EmployeeProfileView.as_view(), name='employee_profile'), path('employer-jobs/', EmployerPostedJobsView.as_view(), name='employer_jobs'),