hello everyone, please help me with this error that is generated in the views.py, in class registro(CreateView): Thank you form.py class RegistrationForm(forms.ModelForm): password = forms.CharField(label='Password', widget=forms.PasswordInput) class Meta: model = UserProfile fields = ('email','password')
def save(self, commit=True): # Save the provided password in hashed format user = super().save(commit=False) user.set_password(self.cleaned_data["password"]) if commit: user.save() return user views.py from .models import UserProfile from .forms import RegistrationForm from django.views.generic.edit import CreateView, UpdateView from django.urls import reverse class registro(CreateView): template_name = 'registration/registro.html' form_class = RegistrationForm def get_context_data(self, *args, **kwargs): context = super(registro, self).get_context_data(*args, **kwargs) context['next'] = self.request.GET.get('next') return context def get_success_url(self): next_url = self.request.POST.get('next') success_url = reverse('home') if next_url: success_url += '?next={}'.format(next_url) return success_url -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/070868ce-cd4a-4231-9685-38144e2cd417n%40googlegroups.com.