Pregunta

Actualmente estoy usando Django-Registration V0.8A y Django-Recaptcha para mi parte de registro. Todo funciona bien con el campo Recaptcha que aparece, excepto que no puedo hacer que el registro formeRiqueemail funcione. Aquí hay algunos de los detalles.

Me he asegurado de que mi captcha forms.py esté subclasificando de la forma correcta:

from registration.forms import RegistrationFormUniqueEmail

class RegistrationFormCaptcha(RegistrationFormUniqueEmail):
captcha = ReCaptchaField(attrs={'theme': 'white'})

También he colocado la tecla Form_Class en todas las URL asociadas con la vista de registro que maneja la llamada, por ejemplo:

url(r'^register/$',
          register,
          { 'form_class': RegistrationFormUniqueEmail,
                'backend': 'registration.backends.default.DefaultBackend' },
          name='registration_register'),

Un comportamiento extraño que he notado es que cuando intento cambiar las etiquetas en mis formas, los cambios no se reflejan. ¿Quizás esto es parte del mismo problema que podría haber pasado por alto algo?

class RegistrationForm(forms.Form):
"""
Form for registering a new user account.

Validates that the requested username is not already in use, and
requires the password to be entered twice to catch typos.

Subclasses should feel free to add any additional validation they
need, but should avoid defining a ``save()`` method -- the actual
saving of collected user data is delegated to the active
registration backend.

"""
username = forms.RegexField(regex=r'^\w+$',
                            max_length=30,
                            widget=forms.TextInput(attrs=attrs_dict),
                            label=_("Username"),
                            error_messages={ 'invalid': _("This value must contain only letters, numbers and underscores.") })
email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict,
                                                           maxlength=75)),
                         label=_("Email address"))
password1 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
                            label=_("Password"))
password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
                            label=_("Password (again)"))

es decir, cambio una de las etiquetas a otra frase, ¿no debería reflejarse eso?

¡Gracias por ver!

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top