Comments (8)
I am trying to figure out that, have you reached a proper solution?
from django-registration.
Have you considered a custom user model for the additional fields? This is one way, alternatively a account model with a 1:1 on the user can be used. I don't think extending the RegistrationProfile
is the right approach. What is the benefit?
Cheers, Andrew
from django-registration.
@macropin,
Thanks for the suggestion. For my use case, I avoided a customer user model for the exact reason described in the documentation. It's usually more practical as you suggested to have a model, call it UserProfile
, with a foreign key or one-to-one relation back to User
.
I actually have a similar setup, but a GroupProfile
model with a one-to-one relationship to Group
. GroupProfile
has additional foreign key relationships to other models as well.
During the user registration we process, we capture information related to both the GroupProfile
and the additional models related to GroupProfile
.
Essentially we capture a variety of data spanning three models, and don't want to create instances of those models unless we, as administrators of the service, approve the user and the provided details. I'm not sure if there is a better design for this process, but it's non-trivial to change it regardless. We might be overloading the functionality of django-registration, but it's working quite well for us nonetheless.
Does that use case scenario make more sense, even if it might be overly unique?
from django-registration.
I think RegistrationForm must be ModelForm of the UserModel() with fields-dependent behavior... May be with several basic customizable fields, e.g. using Django AbstractBaseUser.USERNAME_FIELD insted of UserModel().username, etc..
But it is big work for future.
from django-registration.
@dicato Did you get this sorted in the end? I would love to have the user need to enter a 'secret' word and choose something from a dropdown during the registration process to put in the UserProfile model.
from django-registration.
@willfurnell we used the above approach for awhile. When a User
registered, we forced them to provide two additional pieces of information. We saved that information on our custom RegistrationProfile
and then used it to pre-configure settings in our application.
Feedback from our users and a few people with expertise in user experience told us they did not like this process. We had created additional steps in our registration process and were absolutely losing users because of it.
Instead, we now have a very "standard" registration process where the User
provides their username, email, and a password (only once by the way) and is immediately registered and logged in. The additional fields we were storing on the RegistrationProfile
have been moved to custom models that behave akin to UserProfile
and GroupProfile
. We actually use Django's messages to indicate to the User what settings they must or should configure.
To summarize, we store the fields we care about on other models (UserProfile
, GroupProfile
) and decouple the User entering that information from the registration process in order to make the registration process as easy as possible.
I'm going to close this issue.
from django-registration.
@dicato Could you please explain more on your last approach? The registration just need username, email and password, but when do you require them to finish their profile? Thanks.
from django-registration.
@rylanchiu I've tried to address your question in the issue you filed about collecting User provided images: #123
from django-registration.
Related Issues (20)
- When using Jinja, request user is preferred over ctx_dict's user HOT 2
- In send_activation_email() if email_message.send() fails it creates user anyway HOT 2
- Django 3.0 Support HOT 8
- [question] how to change default location of registration folder HOT 1
- Migrating from django-registration HOT 3
- ACCOUNT_ACTIVATION_DAYS not an int HOT 1
- For more understanding with backends.default.ResendactivationView exception process. HOT 1
- 2fa support or recommend package that works with this packages HOT 1
- Update cleanupregistration output for more understaing
- Show exception message for resend activation email. HOT 3
- Changing default_auto_field for RegistrationProfile HOT 1
- activate_user should send the user_activated signal HOT 1
- I get IntegrityError. Do you have any idea? HOT 1
- ...\> git clone https://github.com/YourGitHubName/django.git django-repo ...\> cd django-repo\tests ...\> py -m pip install -e .. ...\> py -m pip install -r requirements\py3.txt ...\> runtests.py
- New release :pray: HOT 1
- Rename master branch to main HOT 2
- AttributeError: 'WSGIRequest' object has no attribute 'session' trying reset the password HOT 1
- Define the default_auto_field on an AppConfig, not the model, reopening #413
- Some mixed up comments in registration templates
- Use protocol context variable instead of hard coded http
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-registration.