Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added django allauth registration model #147

Conversation

vaibhavsingh97
Copy link
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

from django.http import HttpResponse

def profile(request):
return render(request, "profile.html")

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):

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

@@ -0,0 +1,5 @@
from django.shortcuts import render
from django.http import HttpResponse

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

EMAIL_HOST_PASSWORD='Gorakhpur#1997'
EMAIL_PORT=587
EMAIL_USE_TLS=True
LOGIN_REDIRECT_URL = "profile/"

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

EMAIL_HOST_USER='vaibhav.singh.14cse@bml.edu.in'
EMAIL_HOST_PASSWORD='Gorakhpur#1997'
EMAIL_PORT=587
EMAIL_USE_TLS=True

Choose a reason for hiding this comment

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

missing whitespace around operator

@@ -118,3 +151,10 @@
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'main/'),
)

EMAIL_HOST='smtp.gmail.com'

Choose a reason for hiding this comment

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

missing whitespace around operator

'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',

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)

'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',

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)

'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',

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)


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

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

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.

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"),

Choose a reason for hiding this comment

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

'jQuery' is already defined.

data = {
'is_present': User.objects.filter(username__iexact=username).exists()
}
return JsonResponse(data)

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'),

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 changed the title [WIP] Added django allauth registration model Added django allauth registration model Oct 18, 2017
@coveralls
Copy link

Coverage Status

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

@coveralls
Copy link

Coverage Status

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

Copy link
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
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