Override a Django generic class-based view widget -
say have basic createview form, this, allow new users register on site: from django.contrib.auth import get_user_model django.http import httpresponse django.views.generic import createview user = get_user_model() class signup(createview): model = user fields = ['first_name', 'last_name', 'email', 'password'] i tried this, , found password field rendered in plain text; how go overriding view uses forms.passwordinput() instead? (i realise it's easiest define form hand, i'm curious how you'd that.) you override get_form() , , modify form change widget on password field: from django import forms class signup(createview): model = user fields = ['first_name', 'last_name', 'email', 'password'] def get_form(self, form_class): form = super(signup, self).get_form(form_class) form.fields['password'].widget = forms.passwordinput() return form b...