django-registration

Fill user profile on user registration with Django

烂漫一生 提交于 2021-02-10 11:48:16
问题 I'm developing an application with the user default authentication provided by Django (and django-registration-redux ). Also in docs, they recommend to link the user profile with a OneToOneField in a different model,as explain here: https://docs.djangoproject.com/en/1.10/topics/auth/customizing/ The problem is: How to build a registration view that includes the profile form? Note that it's only creating a user account with the basic data without profile info. I already have worked in other

Fill user profile on user registration with Django

时光毁灭记忆、已成空白 提交于 2021-02-10 11:45:32
问题 I'm developing an application with the user default authentication provided by Django (and django-registration-redux ). Also in docs, they recommend to link the user profile with a OneToOneField in a different model,as explain here: https://docs.djangoproject.com/en/1.10/topics/auth/customizing/ The problem is: How to build a registration view that includes the profile form? Note that it's only creating a user account with the basic data without profile info. I already have worked in other

Fill user profile on user registration with Django

你。 提交于 2021-02-10 11:45:28
问题 I'm developing an application with the user default authentication provided by Django (and django-registration-redux ). Also in docs, they recommend to link the user profile with a OneToOneField in a different model,as explain here: https://docs.djangoproject.com/en/1.10/topics/auth/customizing/ The problem is: How to build a registration view that includes the profile form? Note that it's only creating a user account with the basic data without profile info. I already have worked in other

Django extending user with userprofile (error: User has no profile.)

本秂侑毒 提交于 2021-02-10 05:11:52
问题 someone can told me, why this code don't working? I'm trying to create a registration form for users. I'm getting an error "RelatedObjectDoesNotExist at /signup/client/2/ User has no profile." views.py if request.POST: user_form = UserCreationForm(request.POST) profile_form = ProfileForm(request.POST) if user_form.is_valid() and profile_form.is_valid(): user = user_form.save() user.profile.city="WW" user.profile.phone="32323" user.profile.save() forms.py class UserForm(forms.ModelForm): class

Django extending user with userprofile (error: User has no profile.)

巧了我就是萌 提交于 2021-02-10 05:10:47
问题 someone can told me, why this code don't working? I'm trying to create a registration form for users. I'm getting an error "RelatedObjectDoesNotExist at /signup/client/2/ User has no profile." views.py if request.POST: user_form = UserCreationForm(request.POST) profile_form = ProfileForm(request.POST) if user_form.is_valid() and profile_form.is_valid(): user = user_form.save() user.profile.city="WW" user.profile.phone="32323" user.profile.save() forms.py class UserForm(forms.ModelForm): class

cannot import name get_user_model

点点圈 提交于 2021-01-27 05:22:41
问题 I use django-registrations and while I add this code in my admin.py from django.contrib import admin from customer.models import Customer from .models import UserProfile from django.contrib.auth.admin import UserAdmin from django.contrib.auth import get_user_model class UserProfileInline(admin.StackedInline): model = UserProfile can_delete = False class UserProfileAdmin(UserAdmin): inlines=(UserProfileInline, ) admin.site.unregister(get_user_model()) admin.site.register(get_user_model(),

Django email app broken lines - maximum line length (and how to change it)?

只谈情不闲聊 提交于 2020-01-24 04:16:17
问题 # settings.py EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' # view.py from django.core.mail import send_mail def send_letter(request): the_text = 'this is a test of a really long line that has more words that could possibly fit in a single column of text.' send_mail('some_subject', the_text, 'me@test.com', ['me@test.com']) The Django view code above, results in a text file that contains a broken line: this is a test of a really long line that has more words that could

Django registration form and registration unique email form

末鹿安然 提交于 2020-01-16 14:45:30
问题 I am currently using django-registration v0.8a and django-recaptcha for my registration portion. Everything is working fine with the recaptcha field showing up except that I am unable to get the RegistrationFormUniqueEmail to work. Here are some of the details. I have ensured that my captcha\forms.py is indeed subclassing from the correct form: from registration.forms import RegistrationFormUniqueEmail class RegistrationFormCaptcha(RegistrationFormUniqueEmail): captcha = ReCaptchaField(attrs=

Registration Form Unique Email

隐身守侯 提交于 2020-01-11 09:49:06
问题 I am using django-inspectional-registration which is based on the official django-registration . I would like to ensure the uniqueness of the User's email field but I while I am using: url(r'^register/$', RegistrationView.as_view(), {'form_class' : RegistrationFormUniqueEmail}, name='registration_register'), as suggested, a new registration with the same email always pass the verification. Any suggestions? 回答1: Try passing the form class as an argument to as_view url(r'^register/$',