Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post">
- {% csrf_token %}
- <label for="email">E-Mail</label>
- <input id="email" name="email" type="email" maxlength="50" autofocus="autofocus" required=True unique=True class="form-control">
- <label style="margin-top: 1em;" for="password">Passwort</label>
- <input style="margin-bottom: 2em;" id="password" name="password" type="password" maxlength="25" required=True class="form-control">
- <button class="btn btn-success btn-sm" type="submit" value="login">Login</button>
- def register(request):
- if request.method == 'POST':
- form = RegistrationForm(request.POST, email=request.email)
- if form.is_valid():
- form.save()
- email = form.cleaned_data.get('eemail')
- raw_password = form.cleaned_data.get('password1')
- user = authenticate(email=mail, password=raw_password)
- login(request, user)
- return redirect('accounts:view_profile')
- else:
- form = RegistrationForm()
- args = {'form': form}
- return render(request, 'accounts/reg_form.html', args)
Add Comment
Please, Sign In to add comment