Skip to content

Added django allauth registration model#147

Merged
tapaswenipathak merged 1 commit intoOpenSourceHelpCommunity:predevfrom
vaibhavsingh97:Patch1/registrationModel
Oct 22, 2017
Merged

Added django allauth registration model#147
tapaswenipathak merged 1 commit intoOpenSourceHelpCommunity:predevfrom
vaibhavsingh97:Patch1/registrationModel

Conversation

@vaibhavsingh97
Copy link
Copy Markdown
Member

@vaibhavsingh97 vaibhavsingh97 commented Oct 17, 2017

Checklist

  • My branch is up-to-date with the upstream develop branch.
  • I have added necessary documentation (if appropriate).

Which issue does this PR fix?: fixes #95
Testing link: https://sheltered-depths-79669.herokuapp.com/

Todo:

  • User can login through email/ username
  • Unique username/email
  • Password Strength indicator
  • Email Verification
  • UI enhancement of other forms

Screenshots:
Login Form:
image
image
Signup Form:
image
image
Email Verification
image
Password Reset:
image
Change Password:
image

Features of Password Strength:

  • If the password is same as username and email address, it will show weak
  • It checks for too many character repetitions and the number of character classes used
  • uses zxcvbn

Comment thread oshc/authentication/views.py Outdated
from django.http import HttpResponse

def profile(request):
return render(request, "profile.html") No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

from django.shortcuts import render
from django.http import HttpResponse

def profile(request):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

Comment thread oshc/authentication/views.py Outdated
@@ -0,0 +1,5 @@
from django.shortcuts import render
from django.http import HttpResponse
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'django.http.HttpResponse' imported but unused

Comment thread oshc/oshc/settings.py Outdated
EMAIL_HOST_PASSWORD='Gorakhpur#1997'
EMAIL_PORT=587
EMAIL_USE_TLS=True
LOGIN_REDIRECT_URL = "profile/" No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

Comment thread oshc/oshc/settings.py Outdated
EMAIL_HOST_USER='vaibhav.singh.14cse@bml.edu.in'
EMAIL_HOST_PASSWORD='Gorakhpur#1997'
EMAIL_PORT=587
EMAIL_USE_TLS=True
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace around operator

Comment thread oshc/oshc/settings.py Outdated
os.path.join(BASE_DIR, 'main/'),
)

EMAIL_HOST='smtp.gmail.com'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace around operator

Comment thread oshc/oshc/settings.py
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (83 > 79 characters)

Comment thread oshc/oshc/settings.py
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (82 > 79 characters)

Comment thread oshc/oshc/settings.py
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (81 > 79 characters)

Comment thread oshc/oshc/settings.py

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (91 > 79 characters)

except user_cls.DoesNotExist:
return None
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace


class EmailLoginBackend(object):
'''
This class checks that the user can be authenticated via our backend and if it fails than normal authentication backend is used.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (132 > 79 characters)


try {
if (!jQuery && module && module.exports) {
var jQuery = require("jquery"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'jQuery' is already defined.

@vaibhavsingh97 vaibhavsingh97 force-pushed the Patch1/registrationModel branch from afd5db3 to 8914a0a Compare October 17, 2017 19:47
data = {
'is_present': User.objects.filter(username__iexact=username).exists()
}
return JsonResponse(data) No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

urlpatterns = [
url(r'^accounts/', include('allauth.urls')),
url(r'^accounts/login/profile/', views.profile, name="profile"),
url(r'^ajax/validate_username/$', views.validate_username, name='validate_username'),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

@vaibhavsingh97 vaibhavsingh97 force-pushed the Patch1/registrationModel branch from bf4d12e to 32d8782 Compare October 18, 2017 11:42
@vaibhavsingh97 vaibhavsingh97 changed the title [WIP] Added django allauth registration model Added django allauth registration model Oct 18, 2017
@vaibhavsingh97 vaibhavsingh97 force-pushed the Patch1/registrationModel branch from 8e16ed2 to 0614159 Compare October 18, 2017 12:37
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 69.474% when pulling 0614159 on vaibhavsingh97:Patch1/registrationModel into 2a0e5fd on OpenSourceHelpCommunity:predev.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 69.474% when pulling 0614159 on vaibhavsingh97:Patch1/registrationModel into 2a0e5fd on OpenSourceHelpCommunity:predev.

Copy link
Copy Markdown
Member

@tapaswenipathak tapaswenipathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make it live on another Heroku app first before we merge this to predev. This is on me.

First we all test this there and then come to code review or how we can make it better, if we can.

This is big to review and enables more than one feature in a single pull request, but all up for this, for obvious reasons! 🚀 ❤️

@tapaswenipathak tapaswenipathak merged commit 0614159 into OpenSourceHelpCommunity:predev Oct 22, 2017
Copy link
Copy Markdown
Member

@tapaswenipathak tapaswenipathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't making any previous features down, tested with separate Heroku deployment. We can test on predev itself and enhance things(if needed) and then merge to dev would be cleaner and all up. Merged. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration form django-registration-redux to django-all-auth

4 participants