diff --git a/College/__pycache__/__init__.cpython-310.pyc b/College/__pycache__/__init__.cpython-310.pyc index ea03b37..a42924d 100644 Binary files a/College/__pycache__/__init__.cpython-310.pyc and b/College/__pycache__/__init__.cpython-310.pyc differ diff --git a/College/__pycache__/settings.cpython-310.pyc b/College/__pycache__/settings.cpython-310.pyc index f5ab8b0..a3adbb8 100644 Binary files a/College/__pycache__/settings.cpython-310.pyc and b/College/__pycache__/settings.cpython-310.pyc differ diff --git a/College/__pycache__/urls.cpython-310.pyc b/College/__pycache__/urls.cpython-310.pyc index c883b8f..12cda41 100644 Binary files a/College/__pycache__/urls.cpython-310.pyc and b/College/__pycache__/urls.cpython-310.pyc differ diff --git a/College/__pycache__/wsgi.cpython-310.pyc b/College/__pycache__/wsgi.cpython-310.pyc index f2db079..e100904 100644 Binary files a/College/__pycache__/wsgi.cpython-310.pyc and b/College/__pycache__/wsgi.cpython-310.pyc differ diff --git a/College/settings.py b/College/settings.py index 1ee500c..deff15f 100644 --- a/College/settings.py +++ b/College/settings.py @@ -30,7 +30,17 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.sites', 'home.apps.HomeConfig', + + 'widget_tweaks', + # allauth apps + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + 'allauth.socialaccount.providers.google', + + ] MIDDLEWARE = [ @@ -131,4 +141,36 @@ STATIC_ROOT = BASE_DIR / 'staticfiles' JAZZMIN_SETTINGS = JAZZMIN_SETTINGS -JAZZMIN_UI_TWEAKS = JAZZMIN_UI_TWEAKS \ No newline at end of file +JAZZMIN_UI_TWEAKS = JAZZMIN_UI_TWEAKS + +###### All Auth Settings ##### + +AUTHENTICATION_BACKENDS = [ + # Needed to login by username in Django admin, regardless of `allauth` + 'django.contrib.auth.backends.ModelBackend', + + # `allauth` specific authentication methods, such as login by e-mail + 'allauth.account.auth_backends.AuthenticationBackend', +] + +SITE_ID = 2 # for 127.0.0.1:8000 + +SOCIALACCOUNT_PROVIDERS = { + 'google': { + 'SCOPE': [ + 'profile', + 'email', + ], + 'AUTH_PARAMS': { + 'access_type': 'online', + }, + 'OAUTH_PKCE_ENABLED': True, + } +} + +LOGIN_REDIRECT_URL = '/dashboard/' + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +ACCOUNT_EMAIL_VERIFICATION = "none" + +ACCOUNT_LOGOUT_ON_GET = True diff --git a/College/urls.py b/College/urls.py index 0b508e1..2dd62a4 100644 --- a/College/urls.py +++ b/College/urls.py @@ -4,14 +4,6 @@ urlpatterns = [ path('admin/', admin.site.urls), + path('accounts/', include('allauth.urls')), # all auth path('',include('home.urls')), - path('login',include('home.urls')), - path('purchase',include('home.urls')), - path('register',include('home.urls')), - path('dashboard',include('home.urls')), - path('search_result',include('home.urls')), - path('kiet_page',include('home.urls')), - path('done',include('home.urls')), - path('profile_settings',include('home.urls')), - path('save',include('home.urls')), ] diff --git a/db.sqlite3 b/db.sqlite3 index 4d1e635..a1ce695 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/home/__pycache__/__init__.cpython-310.pyc b/home/__pycache__/__init__.cpython-310.pyc index 5a9ccfb..1bbb2f2 100644 Binary files a/home/__pycache__/__init__.cpython-310.pyc and b/home/__pycache__/__init__.cpython-310.pyc differ diff --git a/home/__pycache__/admin.cpython-310.pyc b/home/__pycache__/admin.cpython-310.pyc index a7af6e5..c134393 100644 Binary files a/home/__pycache__/admin.cpython-310.pyc and b/home/__pycache__/admin.cpython-310.pyc differ diff --git a/home/__pycache__/apps.cpython-310.pyc b/home/__pycache__/apps.cpython-310.pyc index 0583802..0dae48c 100644 Binary files a/home/__pycache__/apps.cpython-310.pyc and b/home/__pycache__/apps.cpython-310.pyc differ diff --git a/home/__pycache__/models.cpython-310.pyc b/home/__pycache__/models.cpython-310.pyc index dcfc833..2bc25a3 100644 Binary files a/home/__pycache__/models.cpython-310.pyc and b/home/__pycache__/models.cpython-310.pyc differ diff --git a/home/__pycache__/urls.cpython-310.pyc b/home/__pycache__/urls.cpython-310.pyc index 7d431e1..8e77417 100644 Binary files a/home/__pycache__/urls.cpython-310.pyc and b/home/__pycache__/urls.cpython-310.pyc differ diff --git a/home/__pycache__/views.cpython-310.pyc b/home/__pycache__/views.cpython-310.pyc index b741a1d..2fd9bb4 100644 Binary files a/home/__pycache__/views.cpython-310.pyc and b/home/__pycache__/views.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0001_initial.cpython-310.pyc b/home/migrations/__pycache__/0001_initial.cpython-310.pyc index 8e85794..c3d9c2f 100644 Binary files a/home/migrations/__pycache__/0001_initial.cpython-310.pyc and b/home/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0002_alter_data_desc_alter_data_img.cpython-310.pyc b/home/migrations/__pycache__/0002_alter_data_desc_alter_data_img.cpython-310.pyc index b02a78f..1aa98ff 100644 Binary files a/home/migrations/__pycache__/0002_alter_data_desc_alter_data_img.cpython-310.pyc and b/home/migrations/__pycache__/0002_alter_data_desc_alter_data_img.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0003_alter_data_img.cpython-310.pyc b/home/migrations/__pycache__/0003_alter_data_img.cpython-310.pyc index 94707b0..04782f9 100644 Binary files a/home/migrations/__pycache__/0003_alter_data_img.cpython-310.pyc and b/home/migrations/__pycache__/0003_alter_data_img.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0004_studentdata.cpython-310.pyc b/home/migrations/__pycache__/0004_studentdata.cpython-310.pyc index 738c4d3..1e07663 100644 Binary files a/home/migrations/__pycache__/0004_studentdata.cpython-310.pyc and b/home/migrations/__pycache__/0004_studentdata.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0005_alter_studentdata_class_10_marks_and_more.cpython-310.pyc b/home/migrations/__pycache__/0005_alter_studentdata_class_10_marks_and_more.cpython-310.pyc index 1f07757..935a5ba 100644 Binary files a/home/migrations/__pycache__/0005_alter_studentdata_class_10_marks_and_more.cpython-310.pyc and b/home/migrations/__pycache__/0005_alter_studentdata_class_10_marks_and_more.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/__init__.cpython-310.pyc b/home/migrations/__pycache__/__init__.cpython-310.pyc index 60100dc..3b6e09e 100644 Binary files a/home/migrations/__pycache__/__init__.cpython-310.pyc and b/home/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/home/urls.py b/home/urls.py index 5590f51..87dce55 100644 --- a/home/urls.py +++ b/home/urls.py @@ -1,16 +1,15 @@ -from django.contrib import admin from django.urls import path from home import views urlpatterns = [ path("", views.index , name ="home"), - path("login", views.login , name ="login"), - path("purchase", views.purchase , name ="purchase"), - path("register", views.register , name ="register"), - path("dashboard", views.dashboard , name ="dashboard"), + path("login/", views.login , name ="login"), + path("purchase/", views.purchase , name ="purchase"), + path("register/", views.register , name ="register"), + path("dashboard/", views.dashboard , name ="dashboard"), path("search/", views.search_result , name ="search"), - path("kiet_page", views.kiet_page , name ="kiet_page"), - path("done", views.done , name ="done"), - path("profile_settings", views.profile_settings , name ="profile_settings"), - path("save", views.save , name ="save"), + path("kiet_page/", views.kiet_page , name ="kiet_page"), + path("done/", views.done , name ="done"), + path("profile_settings/", views.profile_settings , name ="profile_settings"), + path("save/", views.save , name ="save"), ] diff --git a/home/views.py b/home/views.py index cef7d77..79c31f6 100644 --- a/home/views.py +++ b/home/views.py @@ -1,12 +1,15 @@ import email import http -from django.shortcuts import render +from django.contrib.auth.decorators import login_required +from django.shortcuts import render, redirect from .models import Data from .models import StudentData from django.db.models import Q # Create your views here. def index(request): + if request.user.is_authenticated: + return redirect('/dashboard/') return render(request , 'index.html') def login(request): @@ -18,6 +21,7 @@ def purchase(request): def register(request): return render(request , 'register.html') +@login_required(login_url="/accounts/login/") def dashboard(request): return render(request , 'dashboard.html') diff --git a/requirements.txt b/requirements.txt index f9b9813..60b2d61 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,20 @@ asgiref==3.5.2 +certifi==2022.12.7 +cffi==1.15.1 +charset-normalizer==3.0.1 +cryptography==39.0.0 +defusedxml==0.7.1 Django==4.1.1 +django-allauth==0.52.0 +django-jazzmin==2.6.0 +django-widget-tweaks==1.4.12 +idna==3.4 +oauthlib==3.2.2 +pycparser==2.21 +PyJWT==2.6.0 +python3-openid==3.2.0 +requests==2.28.2 +requests-oauthlib==1.3.1 sqlparse==0.4.2 tzdata==2022.2 +urllib3==1.26.14 diff --git a/static/avatar.png b/static/avatar.png new file mode 100644 index 0000000..e9e1a2d Binary files /dev/null and b/static/avatar.png differ diff --git a/templates/account/account_inactive.html b/templates/account/account_inactive.html new file mode 100644 index 0000000..3347f4f --- /dev/null +++ b/templates/account/account_inactive.html @@ -0,0 +1,11 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Account Inactive" %}{% endblock %} + +{% block content %} +

{% trans "Account Inactive" %}

+ +

{% trans "This account is inactive." %}

+{% endblock %} diff --git a/templates/account/base.html b/templates/account/base.html new file mode 100644 index 0000000..cf58393 --- /dev/null +++ b/templates/account/base.html @@ -0,0 +1,42 @@ + + + + + + {% block head_title %}{% endblock %} + {% block extra_head %} + {% endblock %} + + + {% block body %} + + {% if messages %} +
+ Messages: + +
+ {% endif %} + +
+ Menu: + +
+ {% block content %} + {% endblock %} + {% endblock %} + {% block extra_body %} + {% endblock %} + + diff --git a/templates/account/email.html b/templates/account/email.html new file mode 100644 index 0000000..373cd66 --- /dev/null +++ b/templates/account/email.html @@ -0,0 +1,74 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "E-mail Addresses" %}{% endblock %} + +{% block content %} +

{% trans "E-mail Addresses" %}

+{% if user.emailaddress_set.all %} +

{% trans 'The following e-mail addresses are associated with your account:' %}

+ +
+{% csrf_token %} +
+ + {% for emailaddress in user.emailaddress_set.all %} +
+ +
+ {% endfor %} + +
+ + + +
+ +
+
+ +{% else %} +

{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

+ +{% endif %} + + {% if can_add_email %} +

{% trans "Add E-mail Address" %}

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+ {% endif %} + +{% endblock %} + + +{% block extra_body %} + +{% endblock %} diff --git a/templates/account/email/account_already_exists_message.txt b/templates/account/email/account_already_exists_message.txt new file mode 100644 index 0000000..e2733a7 --- /dev/null +++ b/templates/account/email/account_already_exists_message.txt @@ -0,0 +1,13 @@ +{% extends "account/email/base_message.txt" %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% blocktrans %}You are receiving this e-mail because you or someone else tried to signup for an +account using e-mail address: + +{{ email }} + +However, an account using that e-mail address already exists. In case you have +forgotten about this, please use the password forgotten procedure to recover +your account: + +{{ password_reset_url }}{% endblocktrans %}{% endautoescape %}{% endblock %} diff --git a/templates/account/email/account_already_exists_subject.txt b/templates/account/email/account_already_exists_subject.txt new file mode 100644 index 0000000..481edb0 --- /dev/null +++ b/templates/account/email/account_already_exists_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Account Already Exists{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/base_message.txt b/templates/account/email/base_message.txt new file mode 100644 index 0000000..46f04f3 --- /dev/null +++ b/templates/account/email/base_message.txt @@ -0,0 +1,7 @@ +{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name %}Hello from {{ site_name }}!{% endblocktrans %} + +{% block content %}{% endblock %} + +{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}! +{{ site_domain }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/email_confirmation_message.txt b/templates/account/email/email_confirmation_message.txt new file mode 100644 index 0000000..7f922d8 --- /dev/null +++ b/templates/account/email/email_confirmation_message.txt @@ -0,0 +1,7 @@ +{% extends "account/email/base_message.txt" %} +{% load account %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% user_display user as user_display %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}You're receiving this e-mail because user {{ user_display }} has given your e-mail address to register an account on {{ site_domain }}. + +To confirm this is correct, go to {{ activate_url }}{% endblocktrans %}{% endautoescape %}{% endblock %} diff --git a/templates/account/email/email_confirmation_signup_message.txt b/templates/account/email/email_confirmation_signup_message.txt new file mode 100644 index 0000000..9996f7e --- /dev/null +++ b/templates/account/email/email_confirmation_signup_message.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_message.txt" %} diff --git a/templates/account/email/email_confirmation_signup_subject.txt b/templates/account/email/email_confirmation_signup_subject.txt new file mode 100644 index 0000000..4c85ebb --- /dev/null +++ b/templates/account/email/email_confirmation_signup_subject.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_subject.txt" %} diff --git a/templates/account/email/email_confirmation_subject.txt b/templates/account/email/email_confirmation_subject.txt new file mode 100644 index 0000000..b0a876f --- /dev/null +++ b/templates/account/email/email_confirmation_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Please Confirm Your E-mail Address{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/password_reset_key_message.txt b/templates/account/email/password_reset_key_message.txt new file mode 100644 index 0000000..5871c1e --- /dev/null +++ b/templates/account/email/password_reset_key_message.txt @@ -0,0 +1,9 @@ +{% extends "account/email/base_message.txt" %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% blocktrans %}You're receiving this e-mail because you or someone else has requested a password for your user account. +It can be safely ignored if you did not request a password reset. Click the link below to reset your password.{% endblocktrans %} + +{{ password_reset_url }}{% if username %} + +{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %}{% endif %}{% endautoescape %}{% endblock %} diff --git a/templates/account/email/password_reset_key_subject.txt b/templates/account/email/password_reset_key_subject.txt new file mode 100644 index 0000000..6840c40 --- /dev/null +++ b/templates/account/email/password_reset_key_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Password Reset E-mail{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/unknown_account_message.txt b/templates/account/email/unknown_account_message.txt new file mode 100644 index 0000000..e4e89d0 --- /dev/null +++ b/templates/account/email/unknown_account_message.txt @@ -0,0 +1,12 @@ +{% extends "account/email/base_message.txt" %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% blocktrans %}You are receiving this e-mail because you or someone else has requested a +password for your user account. However, we do not have any record of a user +with email {{ email }} in our database. + +This mail can be safely ignored if you did not request a password reset. + +If it was you, you can sign up for an account using the link below.{% endblocktrans %} + +{{ signup_url }}{% endautoescape %}{% endblock %} diff --git a/templates/account/email/unknown_account_subject.txt b/templates/account/email/unknown_account_subject.txt new file mode 100644 index 0000000..6840c40 --- /dev/null +++ b/templates/account/email/unknown_account_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Password Reset E-mail{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email_confirm.html b/templates/account/email_confirm.html new file mode 100644 index 0000000..ac0891b --- /dev/null +++ b/templates/account/email_confirm.html @@ -0,0 +1,31 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} + + +{% block content %} +

{% trans "Confirm E-mail Address" %}

+ +{% if confirmation %} + +{% user_display confirmation.email_address.user as user_display %} + +

{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}

+ +
+{% csrf_token %} + +
+ +{% else %} + +{% url 'account_email' as email_url %} + +

{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}

+ +{% endif %} + +{% endblock %} diff --git a/templates/account/login.html b/templates/account/login.html new file mode 100644 index 0000000..312dafa --- /dev/null +++ b/templates/account/login.html @@ -0,0 +1,107 @@ +{% if not user.is_authenticated %} +{% load widget_tweaks %} +{% load account socialaccount %} +{% load i18n %} +{% block content %} +{% get_providers as socialaccount_providers %} + + + + + + + + + + + + + {% if messages %} +
+ Messages: + +
+ {% endif %} +
+
+ +
+

Xplore

+

Welcome back!

+ {% if socialaccount_providers %} + {% include "socialaccount/snippets/provider_list.html" with process="login" %} + + {% include "socialaccount/snippets/login_extra.html" %} + + {% endif %} + + + + + + + + {% endblock %} +
+
+ +
+ + +{% endif %} diff --git a/templates/account/login1.html b/templates/account/login1.html new file mode 100644 index 0000000..17bc3a6 --- /dev/null +++ b/templates/account/login1.html @@ -0,0 +1,46 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account socialaccount %} + +{% block head_title %}{% trans "Sign In" %}{% endblock %} + +{% block content %} + +

{% trans "Sign In" %}

+ +{% get_providers as socialaccount_providers %} + +{% if socialaccount_providers %} +

{% blocktrans with site.name as site_name %}Please sign in with one +of your existing third party accounts. Or, sign up +for a {{ site_name }} account and sign in below:{% endblocktrans %}

+ +
+ + + +
{% trans 'or' %}
+ +
+ +{% include "socialaccount/snippets/login_extra.html" %} + +{% else %} +

{% blocktrans %}If you have not created an account yet, then please +sign up first.{% endblocktrans %}

+{% endif %} + +
+ {% csrf_token %} + {{ form.as_p }} + {% if redirect_field_value %} + + {% endif %} + {% trans "Forgot Password?" %} + +
+ +{% endblock %} diff --git a/templates/account/logout.html b/templates/account/logout.html new file mode 100644 index 0000000..2549a90 --- /dev/null +++ b/templates/account/logout.html @@ -0,0 +1,21 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Sign Out" %}{% endblock %} + +{% block content %} +

{% trans "Sign Out" %}

+ +

{% trans 'Are you sure you want to sign out?' %}

+ +
+ {% csrf_token %} + {% if redirect_field_value %} + + {% endif %} + +
+ + +{% endblock %} diff --git a/templates/account/messages/cannot_delete_primary_email.txt b/templates/account/messages/cannot_delete_primary_email.txt new file mode 100644 index 0000000..de55571 --- /dev/null +++ b/templates/account/messages/cannot_delete_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You cannot remove your primary e-mail address ({{email}}).{% endblocktrans %} diff --git a/templates/account/messages/email_confirmation_sent.txt b/templates/account/messages/email_confirmation_sent.txt new file mode 100644 index 0000000..7a526f8 --- /dev/null +++ b/templates/account/messages/email_confirmation_sent.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Confirmation e-mail sent to {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/email_confirmed.txt b/templates/account/messages/email_confirmed.txt new file mode 100644 index 0000000..3427a4d --- /dev/null +++ b/templates/account/messages/email_confirmed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/email_deleted.txt b/templates/account/messages/email_deleted.txt new file mode 100644 index 0000000..5cf7cf9 --- /dev/null +++ b/templates/account/messages/email_deleted.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Removed e-mail address {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/logged_in.txt b/templates/account/messages/logged_in.txt new file mode 100644 index 0000000..f49248a --- /dev/null +++ b/templates/account/messages/logged_in.txt @@ -0,0 +1,4 @@ +{% load account %} +{% load i18n %} +{% user_display user as name %} +{% blocktrans %}Successfully signed in as {{name}}.{% endblocktrans %} diff --git a/templates/account/messages/logged_out.txt b/templates/account/messages/logged_out.txt new file mode 100644 index 0000000..2cd4627 --- /dev/null +++ b/templates/account/messages/logged_out.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have signed out.{% endblocktrans %} diff --git a/templates/account/messages/password_changed.txt b/templates/account/messages/password_changed.txt new file mode 100644 index 0000000..bd5801c --- /dev/null +++ b/templates/account/messages/password_changed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Password successfully changed.{% endblocktrans %} diff --git a/templates/account/messages/password_set.txt b/templates/account/messages/password_set.txt new file mode 100644 index 0000000..9d224ee --- /dev/null +++ b/templates/account/messages/password_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Password successfully set.{% endblocktrans %} diff --git a/templates/account/messages/primary_email_set.txt b/templates/account/messages/primary_email_set.txt new file mode 100644 index 0000000..b6a70dd --- /dev/null +++ b/templates/account/messages/primary_email_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Primary e-mail address set.{% endblocktrans %} diff --git a/templates/account/messages/unverified_primary_email.txt b/templates/account/messages/unverified_primary_email.txt new file mode 100644 index 0000000..9c9d0d8 --- /dev/null +++ b/templates/account/messages/unverified_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Your primary e-mail address must be verified.{% endblocktrans %} diff --git a/templates/account/password_change.html b/templates/account/password_change.html new file mode 100644 index 0000000..108cced --- /dev/null +++ b/templates/account/password_change.html @@ -0,0 +1,16 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% trans "Change Password" %}

+ +
+ {% csrf_token %} + {{ form.as_p }} + + {% trans "Forgot Password?" %} +
+{% endblock %} diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html new file mode 100644 index 0000000..de23d9e --- /dev/null +++ b/templates/account/password_reset.html @@ -0,0 +1,24 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Password Reset" %}{% endblock %} + +{% block content %} + +

{% trans "Password Reset" %}

+ {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} + +

{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+ +

{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}

+{% endblock %} diff --git a/templates/account/password_reset_done.html b/templates/account/password_reset_done.html new file mode 100644 index 0000000..d947d79 --- /dev/null +++ b/templates/account/password_reset_done.html @@ -0,0 +1,16 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Password Reset" %}{% endblock %} + +{% block content %} +

{% trans "Password Reset" %}

+ + {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} + +

{% blocktrans %}We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktrans %}

+{% endblock %} diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.html new file mode 100644 index 0000000..7da153b --- /dev/null +++ b/templates/account/password_reset_from_key.html @@ -0,0 +1,19 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}

+ + {% if token_fail %} + {% url 'account_reset_password' as passwd_reset_url %} +

{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}

+ {% else %} +
+ {% csrf_token %} + {{ form.as_p }} + +
+ {% endif %} +{% endblock %} diff --git a/templates/account/password_reset_from_key_done.html b/templates/account/password_reset_from_key_done.html new file mode 100644 index 0000000..85641c2 --- /dev/null +++ b/templates/account/password_reset_from_key_done.html @@ -0,0 +1,9 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% trans "Change Password" %}

+

{% trans 'Your password is now changed.' %}

+{% endblock %} diff --git a/templates/account/password_set.html b/templates/account/password_set.html new file mode 100644 index 0000000..f561572 --- /dev/null +++ b/templates/account/password_set.html @@ -0,0 +1,15 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Set Password" %}{% endblock %} + +{% block content %} +

{% trans "Set Password" %}

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} diff --git a/templates/account/signup.html b/templates/account/signup.html new file mode 100644 index 0000000..b6e38d9 --- /dev/null +++ b/templates/account/signup.html @@ -0,0 +1,134 @@ +{% load i18n %} +{% load widget_tweaks %} + + + + + + + + + + + + +
+
+
+
+
+
+ +
+ + logo + +
+ +
+ Sign Up +
+
+ Register yourself to get started +
+ + + + +
+
+
+
+
+ + diff --git a/templates/account/signup1.html b/templates/account/signup1.html new file mode 100644 index 0000000..8b53b44 --- /dev/null +++ b/templates/account/signup1.html @@ -0,0 +1,21 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Signup" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up" %}

+ +

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}

+ +
+ {% csrf_token %} + {{ form.as_p }} + {% if redirect_field_value %} + + {% endif %} + +
+ +{% endblock %} diff --git a/templates/account/signup_closed.html b/templates/account/signup_closed.html new file mode 100644 index 0000000..bc83950 --- /dev/null +++ b/templates/account/signup_closed.html @@ -0,0 +1,11 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up Closed" %}

+ +

{% trans "We are sorry, but the sign up is currently closed." %}

+{% endblock %} diff --git a/templates/account/snippets/already_logged_in.html b/templates/account/snippets/already_logged_in.html new file mode 100644 index 0000000..00799f0 --- /dev/null +++ b/templates/account/snippets/already_logged_in.html @@ -0,0 +1,5 @@ +{% load i18n %} +{% load account %} + +{% user_display user as user_display %} +

{% trans "Note" %}: {% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}

diff --git a/templates/account/verification_sent.html b/templates/account/verification_sent.html new file mode 100644 index 0000000..3b2d7e5 --- /dev/null +++ b/templates/account/verification_sent.html @@ -0,0 +1,12 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %} + +{% block content %} +

{% trans "Verify Your E-mail Address" %}

+ +

{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. If you do not see the verification e-mail in your main inbox, check your spam folder. Please contact us if you do not receive the verification e-mail within a few minutes.{% endblocktrans %}

+ +{% endblock %} diff --git a/templates/account/verified_email_required.html b/templates/account/verified_email_required.html new file mode 100644 index 0000000..d8e5378 --- /dev/null +++ b/templates/account/verified_email_required.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %} + +{% block content %} +

{% trans "Verify Your E-mail Address" %}

+ +{% url 'account_email' as email_url %} + +

{% blocktrans %}This part of the site requires us to verify that +you are who you claim to be. For this purpose, we require that you +verify ownership of your e-mail address. {% endblocktrans %}

+ +

{% blocktrans %}We have sent an e-mail to you for +verification. Please click on the link inside that e-mail. If you do not see the verification e-mail in your main inbox, check your spam folder. Otherwise +contact us if you do not receive it within a few minutes.{% endblocktrans %}

+ +

{% blocktrans %}Note: you can still change your e-mail address.{% endblocktrans %}

+ + +{% endblock %} diff --git a/templates/dashboard.html b/templates/dashboard.html index d75c29a..f661b12 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -12,7 +12,7 @@ {% load static %} - + @@ -60,25 +60,21 @@
+
-
-
Sample User
+
+
{{request.user}}
@@ -190,6 +186,15 @@ + {% if messages %} +
+ +
+ {% endif %}
@@ -881,7 +886,7 @@


-
+
+ {% if messages %} +
+ Messages: +
    + {% for message in messages %} +
  • {{message}}
  • + {% endfor %} +
+
+ {% endif %}
@@ -87,7 +99,7 @@

Navigating Lives

Providing an easy way to apply to your dream college

- + @@ -586,7 +598,7 @@

- + @@ -789,7 +801,7 @@

Get started with Xplore and make the trip to your dream college easier.

-
+ diff --git a/templates/login.html b/templates/login.html index 6a5a0c9..39931b5 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,3 +1,8 @@ +{% load i18n %} +{% load account socialaccount %} +{% block content %} +{% get_providers as socialaccount_providers %} + @@ -19,43 +24,53 @@

Brand

Welcome back!

-
-
- - - - - - -
-

Sign in with Google

-
+ {% if socialaccount_providers %} + {% include "socialaccount/snippets/provider_list.html" with process="login" %} + + {% include "socialaccount/snippets/login_extra.html" %} + + {% endif %} + -
- - -
-
-
- - Forget Password? +
-
+
+
+ + Forget Password? +
+ +
+
-
-
- - or sign up - -
+
+
+ + or sign up + +
+
+ +
+ +
+ {% endblock %} +

diff --git a/templates/openid/base.html b/templates/openid/base.html new file mode 100644 index 0000000..671d403 --- /dev/null +++ b/templates/openid/base.html @@ -0,0 +1 @@ +{% extends "socialaccount/base.html" %} diff --git a/templates/openid/login.html b/templates/openid/login.html new file mode 100644 index 0000000..b27ee37 --- /dev/null +++ b/templates/openid/login.html @@ -0,0 +1,18 @@ +{% extends "openid/base.html" %} + +{% load i18n %} + +{% block head_title %}OpenID Sign In{% endblock %} + +{% block content %} + +

{% trans 'OpenID Sign In' %}

+ + + + +{% endblock %} diff --git a/templates/socialaccount/authentication_error.html b/templates/socialaccount/authentication_error.html new file mode 100644 index 0000000..0300295 --- /dev/null +++ b/templates/socialaccount/authentication_error.html @@ -0,0 +1,11 @@ +{% extends "socialaccount/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Social Network Login Failure" %}{% endblock %} + +{% block content %} +

{% trans "Social Network Login Failure" %}

+ +

{% trans "An error occurred while attempting to login via your social network account." %}

+{% endblock %} diff --git a/templates/socialaccount/base.html b/templates/socialaccount/base.html new file mode 100644 index 0000000..b64fd56 --- /dev/null +++ b/templates/socialaccount/base.html @@ -0,0 +1 @@ +{% extends "account/base.html" %} diff --git a/templates/socialaccount/connections.html b/templates/socialaccount/connections.html new file mode 100644 index 0000000..f7c2729 --- /dev/null +++ b/templates/socialaccount/connections.html @@ -0,0 +1,54 @@ +{% extends "socialaccount/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Account Connections" %}{% endblock %} + +{% block content %} +

{% trans "Account Connections" %}

+ +{% if form.accounts %} +

{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}

+ + +
+{% csrf_token %} + +
+{% if form.non_field_errors %} +
{{ form.non_field_errors }}
+{% endif %} + +{% for base_account in form.accounts %} +{% with base_account.get_provider_account as account %} +
+ +
+{% endwith %} +{% endfor %} + +
+ +
+ +
+ +
+ +{% else %} +

{% trans 'You currently have no social network accounts connected to this account.' %}

+{% endif %} + +

{% trans 'Add a 3rd Party Account' %}

+ +
    +{% include "socialaccount/snippets/provider_list.html" with process="connect" %} +
+ +{% include "socialaccount/snippets/login_extra.html" %} + +{% endblock %} diff --git a/templates/socialaccount/login.html b/templates/socialaccount/login.html new file mode 100644 index 0000000..0ce2ed9 --- /dev/null +++ b/templates/socialaccount/login.html @@ -0,0 +1,21 @@ +{% extends "socialaccount/base.html" %} +{% load i18n %} + +{% block head_title %}{% trans "Sign In" %}{% endblock %} + +{% block content %} +{% if process == "connect" %} +

{% blocktrans with provider.name as provider %}Connect {{ provider }}{% endblocktrans %}

+ +

{% blocktrans with provider.name as provider %}You are about to connect a new third party account from {{ provider }}.{% endblocktrans %}

+{% else %} +

{% blocktrans with provider.name as provider %}Sign In Via {{ provider }}{% endblocktrans %}

+ +

{% blocktrans with provider.name as provider %}You are about to sign in using a third party account from {{ provider }}.{% endblocktrans %}

+{% endif %} + +
+ {% csrf_token %} + +
+{% endblock %} diff --git a/templates/socialaccount/login_cancelled.html b/templates/socialaccount/login_cancelled.html new file mode 100644 index 0000000..8d76786 --- /dev/null +++ b/templates/socialaccount/login_cancelled.html @@ -0,0 +1,15 @@ +{% extends "socialaccount/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Login Cancelled" %}{% endblock %} + +{% block content %} + +

{% trans "Login Cancelled" %}

+ +{% url 'account_login' as login_url %} + +

{% blocktrans %}You decided to cancel logging in to our site using one of your existing accounts. If this was a mistake, please proceed to sign in.{% endblocktrans %}

+ +{% endblock %} diff --git a/templates/socialaccount/messages/account_connected.txt b/templates/socialaccount/messages/account_connected.txt new file mode 100644 index 0000000..be6aa60 --- /dev/null +++ b/templates/socialaccount/messages/account_connected.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}The social account has been connected.{% endblocktrans %} diff --git a/templates/socialaccount/messages/account_connected_other.txt b/templates/socialaccount/messages/account_connected_other.txt new file mode 100644 index 0000000..e90f6cc --- /dev/null +++ b/templates/socialaccount/messages/account_connected_other.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}The social account is already connected to a different account.{% endblocktrans %} diff --git a/templates/socialaccount/messages/account_connected_updated.txt b/templates/socialaccount/messages/account_connected_updated.txt new file mode 100644 index 0000000..3f7174e --- /dev/null +++ b/templates/socialaccount/messages/account_connected_updated.txt @@ -0,0 +1 @@ +{% extends "socialaccount/messages/account_connected.txt" %} diff --git a/templates/socialaccount/messages/account_disconnected.txt b/templates/socialaccount/messages/account_disconnected.txt new file mode 100644 index 0000000..fd43f30 --- /dev/null +++ b/templates/socialaccount/messages/account_disconnected.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}The social account has been disconnected.{% endblocktrans %} diff --git a/templates/socialaccount/signup.html b/templates/socialaccount/signup.html new file mode 100644 index 0000000..caa2de2 --- /dev/null +++ b/templates/socialaccount/signup.html @@ -0,0 +1,22 @@ +{% extends "socialaccount/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Signup" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up" %}

+ +

{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to +{{site_name}}. As a final step, please complete the following form:{% endblocktrans %}

+ + + +{% endblock %} diff --git a/templates/socialaccount/snippets/login_extra.html b/templates/socialaccount/snippets/login_extra.html new file mode 100644 index 0000000..307def4 --- /dev/null +++ b/templates/socialaccount/snippets/login_extra.html @@ -0,0 +1,3 @@ +{% load socialaccount %} + +{% providers_media_js %} diff --git a/templates/socialaccount/snippets/provider_list.html b/templates/socialaccount/snippets/provider_list.html new file mode 100644 index 0000000..234a170 --- /dev/null +++ b/templates/socialaccount/snippets/provider_list.html @@ -0,0 +1,45 @@ +{% load socialaccount %} + +{% get_providers as socialaccount_providers %} + +{% for provider in socialaccount_providers %} +{% if provider.id == "openid" %} +{% for brand in provider.get_brands %} + +
  • + {{brand.name}} +
  • + +{% endfor %} +{% endif %} + +{% comment %} check if the provider is gogole {% endcomment %} + +{% if provider.name == "Google" %} +{% comment %} {% endcomment %} +
    + {% csrf_token %} + +
    +{%else%} +
  • + {{provider.name}} +
  • +{% endif %} + +{% endfor %} diff --git a/templates/tests/test_403_csrf.html b/templates/tests/test_403_csrf.html new file mode 100644 index 0000000..86f9aea --- /dev/null +++ b/templates/tests/test_403_csrf.html @@ -0,0 +1,2 @@ +{% load socialaccount %} +Sign In