Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Logins(request):
- if request.method == 'POST':
- username = request.POST['username']
- password = request.POST['password']
- user = authenticate(username=username, password=password)
- if user is not None and user.is_active:
- login(request, user)
- return HttpResponseRedirect('music/login')
- return HttpResponseRedirect('music/login')
- form = Userlogin
- return render(request, 'music/login.html', {'Login_form': Userlogin})
- [It shows MultiValueDictKeyError at /music/login/.][1]
- {% block body %}
- {% if form.errors %}
- <p>Something is wrong</p>
- {% endif %}
- <form action="" method="post">
- {% csrf_token %}
- <label for="email">Login:</label>
- <label for="password">Password:</label>
- <input type="password" name="password" value="" id="username">
- <input type="submit" value="login" />
- </form>
- {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement