我想在view.py中的方法完成后有一个alert()消息(如javascript中的消息)
我的方法是
def change_password(request):
dictData = getInitialVariable(request)
in_username = request.POST['txt_username']
in_password = request.POST['txt_password']
in_new_password = request.POST['txt_new_password']
user = authenticate(username=in_username, password=in_password)
if user is not None:
if user.is_active:
u = User.objects.get(username=in_username)
u.set_password(in_new_password)
u.save()
# Redirect to a success page.
return HttpResponseRedirect('/profiles/'+in_username)
Run Code Online (Sandbox Code Playgroud)
将u保存到数据库后,将显示弹出消息。我该如何实施?