Coder Social home page Coder Social logo

Comments (7)

ubernostrum avatar ubernostrum commented on June 24, 2024 1

I've thought about this a lot, and I think the only way forward is to finally just give up on using Django's UserCreationForm.

That's a backwards-incompatible change, so I can't do it immediately, but once I get a release out for official Django 4.2 compatibility I'll start on a major version bump branch that will ship its own base form that doesn't hard-wire in the default Django User model.

from django-registration.

ubernostrum avatar ubernostrum commented on June 24, 2024

I need to think about this one.

from django-registration.

kbarnes3 avatar kbarnes3 commented on June 24, 2024

I was able to work around this by setting my EmailField to be named username. This wasn't too difficult since I'm trying to incorporate Django-Registration into a new project that hasn't been deployed yet, but I imagine it would be more difficult for established sites to do this.

from django-registration.

ubernostrum avatar ubernostrum commented on June 24, 2024

The thing that's worrying me here is that there's no such thing as a truly generic user-registration view/form for Django. The amount of stuff you can do in a custom user model just makes it impossible to write a single form that can handle anything someone might do. And the documentation on using a custom user model with django-registration already makes clear that there are times when you're going to have to write your own stuff rather than be able to use simple subclasses of the built-in forms/views.

So I'm leaning toward just doing a better job of documenting what django-registration can support, and maybe better documentation of what you need to do when your user model gets too different from that.

from django-registration.

kbarnes3 avatar kbarnes3 commented on June 24, 2024

I think a big problem with this issue is that the errors occur on import time. As it is structured now, not only do I have to write my own form, but I can't use the RegistrationView (because I can't import it) nor the URLs (because those import the RegistrationView as well). It would be nice if these errors could be deferred in some way to when the impacted classes are instantiated or something similar.

from django-registration.

confuzeus avatar confuzeus commented on June 24, 2024

Why not use get_user_model in the RegistrationForm? I just submitted a PR for that but don't know if I'm missing a case where not using Django's default might break someone's code.

from django-registration.

ubernostrum avatar ubernostrum commented on June 24, 2024

Yeah, the issue is that UserCreationForm has defaulted to the built-in User forever, and I don't even know how much stuff depends on it.

If it's going to change, it'll have to change in a major version bump. I'm thinking through whether I want to do that to cover this case, since it's one that comes up but not super often, and the case of differing significantly from Django's built-in model is already one that has a lot of warnings in the docs.

from django-registration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.