Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. url(r'^(?P<pk>[w.@+-]+)$', ProfileDashboardView , name='dashboard')
  2.  
  3. @login_required
  4. def ProfileDashboardView(request, name=None):
  5. usr_name = IbkUser.objects.get(name=name)
  6. return render(request, 'profiles/profile_dashboard.html')
  7.  
  8. class LoginAuthenticationForm(AuthenticationForm):
  9. """
  10. A user login form for registered users.
  11. """
  12. username = forms.EmailField(label='Email', required=True, widget=forms.TextInput(attrs={'id': 'login_username'}))
  13. password = forms.CharField(label='Password', required=True,widget=forms.PasswordInput(attrs={'id': 'login_password'}))
  14.  
  15. def __init__(self, *args, **kwargs):
  16. super(LoginAuthenticationForm, self).__init__(*args, **kwargs)
  17. self.helper = FormHelper()
  18. self.helper.form_id = 'loginForm'
  19. self.helper.form_method = 'post'
  20. self.helper.layout = Layout(
  21. PrependedText('username', "<span class='glyphicon glyphicon-envelope'></span>", active=True),
  22. PrependedText('password', "<span class='glyphicon glyphicon-lock'></span>", active=True),
  23. FormActions(
  24. Submit('submit', 'Submit', css_class ='btn btn-success btn-lg btn-block'),
  25. ),
  26. )
  27.  
  28. {% extends "auths/base.html" %}
  29. {%load staticfiles%}
  30. {% load crispy_forms_tags%}
  31.  
  32. {%block auths_title%}Login{%endblock auths_title%}
  33. {%block auths_css%}{%endblock auths_css%}
  34.  
  35. {%block auths_body%}
  36. <div class="row" id="signup-container">
  37. <div class="col-md-4"></div>
  38. <div class="col-md-4">
  39. <div class="page-header text-info text-center">
  40. <h2>Login</h2>
  41. </div>
  42. {% crispy form form.helper %}
  43. <p class="text-center">
  44. Forgot your password? <a href="{% url 'auths:recover'%}">Reset Password</a>
  45. </p>
  46. <p class="text-center">
  47. <small>Don't have an account ? <a href="{% url 'accounts:register' %}">Sign up</a></small>
  48. </p>
  49. <div class="col-md-4"></div>
  50. </div>
  51. </div>
  52. {%endblock auths_body%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement