Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url(r'^(?P<pk>[w.@+-]+)$', ProfileDashboardView , name='dashboard')
- @login_required
- def ProfileDashboardView(request, name=None):
- usr_name = IbkUser.objects.get(name=name)
- return render(request, 'profiles/profile_dashboard.html')
- class LoginAuthenticationForm(AuthenticationForm):
- """
- A user login form for registered users.
- """
- username = forms.EmailField(label='Email', required=True, widget=forms.TextInput(attrs={'id': 'login_username'}))
- password = forms.CharField(label='Password', required=True,widget=forms.PasswordInput(attrs={'id': 'login_password'}))
- def __init__(self, *args, **kwargs):
- super(LoginAuthenticationForm, self).__init__(*args, **kwargs)
- self.helper = FormHelper()
- self.helper.form_id = 'loginForm'
- self.helper.form_method = 'post'
- self.helper.layout = Layout(
- PrependedText('username', "<span class='glyphicon glyphicon-envelope'></span>", active=True),
- PrependedText('password', "<span class='glyphicon glyphicon-lock'></span>", active=True),
- FormActions(
- Submit('submit', 'Submit', css_class ='btn btn-success btn-lg btn-block'),
- ),
- )
- {% extends "auths/base.html" %}
- {%load staticfiles%}
- {% load crispy_forms_tags%}
- {%block auths_title%}Login{%endblock auths_title%}
- {%block auths_css%}{%endblock auths_css%}
- {%block auths_body%}
- <div class="row" id="signup-container">
- <div class="col-md-4"></div>
- <div class="col-md-4">
- <div class="page-header text-info text-center">
- <h2>Login</h2>
- </div>
- {% crispy form form.helper %}
- <p class="text-center">
- Forgot your password? <a href="{% url 'auths:recover'%}">Reset Password</a>
- </p>
- <p class="text-center">
- <small>Don't have an account ? <a href="{% url 'accounts:register' %}">Sign up</a></small>
- </p>
- <div class="col-md-4"></div>
- </div>
- </div>
- {%endblock auths_body%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement