Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified codeara/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified codeara/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file modified codeara/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified codeara/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
15 changes: 10 additions & 5 deletions codeara/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'social_django.context_processors.backends',
'social_django.context_processors.login_redirect',
],
},
},
Expand Down Expand Up @@ -108,8 +110,11 @@

USE_TZ = True

ACCOUNT_EMAIL_REQUIRED = False
ACCOUNT_USERNAME_REQUIRED = False
Client_id = config('Client_id')
Client_secret = config('Client_secret')
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED=False
ACCOUNT_AUTHENTICATION_METHOD="email"

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
Expand All @@ -121,9 +126,9 @@
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
)

Client_id = config('Client_id')
Client_secret = config('Client_secret')
EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend'
ACCOUNT_EMAIL_VERIFICATION='none'
EMAIL_FILE_PATH = os.path.join(BASE_DIR,'sent_emails')

ERROR_MESSAGE = "Something went wrong please try again"
CORECT_SUBMISSION_MESSAGE = "Correct!!"
Expand Down
Binary file modified compiler/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified compiler/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file modified compiler/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file modified compiler/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified compiler/__pycache__/views.cpython-38.pyc
Binary file not shown.
Binary file modified compiler/migrations/__pycache__/0001_initial.cpython-38.pyc
Binary file not shown.
Binary file modified compiler/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified user/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified user/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file modified user/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file modified user/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified user/__pycache__/views.cpython-38.pyc
Binary file not shown.
Binary file modified user/migrations/__pycache__/0001_initial.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file modified user/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
34 changes: 30 additions & 4 deletions user/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,52 @@
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Sign In" %}</h1>
<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
<!-- <br> Username:
<input type="text" name="{{form.username}}" size = "20">
<br> <br> <br> Password:
<input type="password" name="{{form.password}}" size="20">
<br> <br><br> <input type="submit" value = "Sign In" size=15> -->
<!--{{form.as_p}} -->
{% for field in form %}
<p>
{{ field.label_tag }}&nbsp;{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br> Forgot Password? <a href="{% url 'account_reset_password' %}">Reset Password</a>
<br> <button class="btn login-signup-button" type="submit">{% trans 'Sign In' %}</button>
</form>

<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
<div class="links">
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
<div class="social-login-bar">
<div class="social-login-text"></div>
<div class="social-login-text">or sign in with</div>
<a href="/accounts/google/login/?process=login">
<i class="fa fa-3x fa-google"></i>
<i class="fa fa-3x fa-google"></i> <!--GOOGLE ICON-->
</a>
<!--

<a href="/accounts/github/login/?process=login">
<i class="fa fa-3x fa-github"></i>
</a>
<a href="/accounts/facebook/login/?process=login">
<i class="fa fa-3x fa-facebook"></i>
</a>-->
</a>
</div>
{% endif %}

</div>
</form>
Don't have an account? <a href="{% url 'account_signup' %}">Create account </a>
<br> <br>
</div>
{% endblock %}
29 changes: 29 additions & 0 deletions user/templates/account/password_change.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% extends 'account/base.html' %}

{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Password Management" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Password Management" %}</h1>
<form method="post" action="{% url 'account_change_password' %}">
{% csrf_token %}
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
<button class="btn login-signup-button" type="submit">{% trans 'Change Password' %}</button>

<br>
</form>
</div>
{% endblock %}
32 changes: 32 additions & 0 deletions user/templates/account/password_reset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends 'account/base.html' %}


{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Password Management" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Password Management" %}</h1>
<form method="post" action="{% url 'account_reset_password' %}">
{% csrf_token %}
<p>Enter your e-mail address below, and we'll send you </p>
<p>an e-mail allowing you to reset it.</p>
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
<button class="btn login-signup-button" type="submit">{% trans 'Reset Password' %}</button>

<br>
</form>
</div>
{% endblock %}
23 changes: 23 additions & 0 deletions user/templates/account/password_reset_done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends 'account/base.html' %}


{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Password Management" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Password Management" %}</h1>
<form method="post">
{% csrf_token %}
<p>We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.</p>
{% for field in form %}
<p>
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
</form>
</div>
{% endblock %}
38 changes: 38 additions & 0 deletions user/templates/account/password_reset_from_key.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block content %}
<h1>{% if token_fail %}{% trans "Bad Token" %}{% endif %}</h1>

{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
{% else %}
{% if form %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Password Management" %}</h1>
<form method="post" action="{{ action_url }}">
{% csrf_token %}
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
<button class="btn login-signup-button" type="submit">{% trans 'Reset Password' %}</button>
<br><br>
</form>
</div>
{% else %}
<p>{% trans 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
{% endblock %}
23 changes: 23 additions & 0 deletions user/templates/account/password_reset_from_key_done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends 'account/base.html' %}


{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Password Management" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Password Management" %}</h1>
<form method="post">
{% csrf_token %}
<p>Your Password is now changed</p>
{% for field in form %}
<p>
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
</form>
</div>
{% endblock %}
30 changes: 30 additions & 0 deletions user/templates/account/password_set.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends 'account/base.html' %}


{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Password Management" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Password Management" %}</h1>
<form method="post" action="{% url 'account_set_password' %}">
{% csrf_token %}
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
<button class="btn login-signup-button" type="submit">{% trans 'Set Password' %}</button>

<br>
</form>
</div>
{% endblock %}
30 changes: 30 additions & 0 deletions user/templates/account/signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends 'account/base.html' %}


{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Sign Up" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Sign Up" %}</h1>
<form method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
<button class="btn login-signup-button" type="submit">{% trans 'Sign Up' %}</button>

<br>
</form>
</div>
{% endblock %}
14 changes: 12 additions & 2 deletions user/templates/profile.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{% extends 'base.html' %}

{% load static%}
{% block body %}
{% block content %}
{% load account socialaccount %}
<div class="container login-signup-container" id="login_cont">
<h2> WELCOME, </h2>
{% if user.socialaccount_set.all.0.get_avatar_url%}
<p><img src="{{user.socialaccount_set.all.0.get_avatar_url}}"
width="50" height="50"></p>
{% else %}
<p><img src="{% static 'compiler/image/peng.png' %}" width="50" height="50"></p>
{% endif %}
{{ user.socialaccount_set.all.0.extra_data.name }} ({{ user }}).<br>
<br>No. of Submissions : {{usr.n_subm}} <br>
<!-- <br>No. of Succesful Submissions : {{usr.n_s_sub}}<br>-->
<br>Languages Used : {{usr.lang}} <br>
<br>Languages Used : {{usr.lang}} <br><br>
{% if user.has_usable_password %}
<a href="{% url 'account_change_password' %}">Password Management</a>
{% else %}
<a href="{% url 'account_set_password' %}">Password Management</a>
{% endif %}
<br>
<br>
</div>
{% endblock content %}
Expand Down
30 changes: 30 additions & 0 deletions user/templates/socialaccount/signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends 'account/base.html' %}


{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Sign Up" %}{% endblock %}
{% block content %}
<div class="container login-signup-container" id="login_cont">
<h1>{% trans "Sign Up" %}</h1>
<form method="post" action="{% url 'socialaccount_signup' %}">
{% csrf_token %}
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<br>
<button class="btn login-signup-button" type="submit">{% trans 'Sign Up' %}</button>

<br>
</form>
</div>
{% endblock %}
Loading