views.py 566 B

1234567891011121314151617
  1. import pprint
  2. # from django.http import HttpResponse
  3. # from django.template import Context, loader
  4. from django.shortcuts import render, get_object_or_404
  5. from django.http import Http404
  6. from coin.members.models import Member
  7. def index(request):
  8. return HttpResponse("Hello, world. You're at the members index.")
  9. def change_password(request, member_id):
  10. member = get_object_or_404(Member, pk=member_id)
  11. if request.POST['password']:
  12. member.password = ''
  13. else :
  14. return render(request, 'members/change_password.html', {'member':member})