> > Thank you for your help Andre You're welcome!
> I've now worked out what the problem > was. I was editing the wrong copy of the source code (it happens to > everyone at some point!) so no wonder the changes were not > happening... Happens to me more often than I'd like to admit... > In the end I just created a completely new url path (i.e. > not 'accounts/register') and called registration.views with a > completely new form class in the dictionary parameter. > This is precisely how you're supposed to use it. > > Here's my final code with the RegistrationForm for reference. In my > project's urls.py I added the following lines: > > import registration.backends.default.urls # > django-registration urls > from registration.views import register # > django-registration view > from myapp.newform import MyNewRegistrationForm # my own > customised form > > urlpatterns = patterns('', > url(r'^accounts/', include(registration.backends.default.urls)), > url(r'^accounts/registration/$', register, {'backend': > 'registration.backends.default.DefaultBackend', 'form_class': > MyNewRegistrationForm }, > name='registration_register'), > > I just copied the code from the original RegistrationForm class to > myapp.newform and added my customised fields, including the > TermsOfService field I originally wanted... > While this approach works, it is harder to maintain because any updates (ie. fixes, new features, etc) that are added to the original RegistrationForm will never make it to MyNewRegistrationForm. So subclassing and adding just the TOS logic would be the best approach. It also improves readability for you, since you'll just have to look to a couple of lines in your MyNewRegistrationForm as opposed to the whole logic. Considering someone else maintains django-registration, you can leave that part of the code for them to worry and just work on your project-specific stuff. (I'm not sure how clear that paragraph is, so feel free to ask questions!) Cheers, André Terra > > On Jul 11, 2:13 pm, Andre Terra <andrete...@gmail.com> wrote: > > My guess is that there's another module somewhere in your PYTHONPATH from > > which django is importing these forms. > > > > Also, don't edit registration.forms, subclass the form instead. > > > > You can also try {{ form.as_p }} to make sure the problem isn't in the > > template. > > > > You can raise an exception somewhere in your code to try to find where in > > the python path the module lives. Try something like > > > > def your_view(request): > > # ... > > # your current code > > # ... > > from registration import forms > > assert False, forms.__file__ > > > > Good luck! > > > > Cheers, > > André > > > > > > > > > > > > > > > > On Mon, Jul 11, 2011 at 8:45 AM, katstevens <kat.stev...@gmail.com> > wrote: > > > OK I must have missed something fundamental. I installed v0.8 and > > > having started all over again, I only made one change - adding an > > > extra field to the basic RegistrationForm class in registration.forms > > > - this isn't showing up on my template either! > > > > > Looking over my code, I've found it's not just the Registration form > > > class - when I try altering the default label in e.g. > > > PasswordResetForm (from django.contrib.auth.forms) the change doesn't > > > show up in my template either ( {{ form.email.label_tag }} ), it still > > > displays the default. Is there another mysterious source that django > > > is getting the form class declaration from instead, or is it just > > > ignoring my changes for some reason? I'm not getting any errors and > > > the form itself still works correctly. I haven't changed any of the > > > default code for PasswordResetForm (urls, views, forms) except that > > > one label. I can't understand this behaviour at all. > > > > > On Jul 11, 10:46 am, katstevens <kat.stev...@gmail.com> wrote: > > > > I think that's it! I'm using v0.7 and will upgrade now - thanks for > > > > the heads up. > > > > > > On Jul 8, 6:52 pm, CareerDhaba tech <t...@careerdhaba.com> wrote: > > > > > > > I believe you are using an older version of django_registration, > since > > > there > > > > > is no reference to the backend in your code. The backend is an > addition > > > in > > > > > the latest (0.8) version of django_registration. > > > > > > > Did you download the code from here? > > >http://readthedocs.org/docs/django-registration/en/latest/index.html > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Django users" group. > > > To post to this group, send email to django-users@googlegroups.com. > > > To unsubscribe from this group, send email to > > > django-users+unsubscr...@googlegroups.com. > > > For more options, visit this group at > > >http://groups.google.com/group/django-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.