django-registration

Django-registration: How to allow user delete their account?

≯℡__Kan透↙ 提交于 2019-12-04 14:38:49
问题 I have a simple website where users can register in order to have access to private content and to receive a newsletter. I have used django-registration for user registration and authentication, and used some HTML templates from here. The whole system is working (login, logout, password recovery, etc.) but I realized that user cannot delete their account from the website. Is there a plugin designed for this, or how to extend the registration classes to do that? By deleting, I'd prefer a real

Django - Ajax registration

帅比萌擦擦* 提交于 2019-12-04 13:52:09
问题 I am trying to allow registration (using this django-registration register view) to one of my applications from a modal dialog. Since this form is in a modal box, I'd like to get an json reponse on success (instead of the default redirection) How can I use this view (django-registration register) to manage the registration and send back a json response on success ? I know how to make ajax/json responses, the question is how to use the django-registration view without the redirection behavior

Connecting a django-registration signal

◇◆丶佛笑我妖孽 提交于 2019-12-04 13:33:54
I have a function: def create(sender, **kw): [...] Which should be called when the user_activated signal from django-registration is called. I connect the signal and the function using this: from registration.signals import user_activated [...] post_save.connect(create, sender=user_activated, dispatch_uid="users-atactivation-signal") But the function isn't called when a user clicks on the activation link, which he got by email. What do I miss here. A function like this: def create(sender, user, request, **kwarg): [...] and a connect call like this: user_activated.connect(create) does the job.

What/Where to modify django-registration to use with mobile broswers

假如想象 提交于 2019-12-04 10:56:10
I am using django-registration along side django auth for my client account creation and login. Our site will be used by moble users and desktop users. We just started tackling the idea of mobile users by loading different templates from the view depending on user agent strings. It's cleanly done, but I am not sure if it is the right way to do it as we are now stuck with what to do on views that are not easily accessible (that we didn't write ourselves). Which brings me to the problem at hand: I have no idea how to tackle redirecting the mobile user away from the login url that django

How to redirect users to a specific url after registration in django registration?

爷,独闯天下 提交于 2019-12-04 10:51:52
问题 So I am using django-registration app to implement a user registration page for my site. I used Django's backends.simple views which allows the users to immediately login after registration. My question is how do I redirect them to my other app's page located in the same directory as the project. Here is what my main urls.py looks like: from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin

How can i make django-rest-framework-jwt return token on registration?

老子叫甜甜 提交于 2019-12-04 07:55:32
问题 I have a basic django rest service, which registers a person and updates his password. I want to add jwt authentication on top of it. If I follow the tutorial I would need to add a new url named "api-token-auth" in project's urls.py. But, I don't want to add this new url and want my register call to send a token in response. Here's my code: serializers.py class UserSerializer(serializers.HyperlinkedModelSerializer): def create(self, validated_data): user = User( username=validated_data[

Django-registration setup without password

99封情书 提交于 2019-12-03 20:47:29
I am trying to make a website, where people only put their email addresses and they are logged in with cookies and all. At a later stage, i will ask them provide password and names, but NO username will be used. I am trying to do this with django-registraition, but i get errors and i have a few problems. First to disable usernames as a login feature, i put str(time()) instead of username - i was looking for something that will change every time. However, when I skip the authentication (which i currently don't need) i get error: 'RegistrationProfile' object has no attribute 'backend'

Creating a Django Registration Form by Extending Django-Registation Application

纵然是瞬间 提交于 2019-12-03 17:15:08
Am trying to create a registration form by extending django-registration app and using Django Profile. I have created the model and form for the profile and when I checked through the django shell it is generating the fields. For the profile fields i am using ModelForm. Now I am struck on how to bring both the django-registration and the profile fields together. Following are the code i have developed model.py class UserProfile(models.Model): """ This class would define the extra fields that is required for a user who will be registring to the site. This model will be used for the Django

How to add placeholder to forms of Django-Registration

梦想与她 提交于 2019-12-03 16:10:54
I am using django-registration for my project. in my registration_form.html file: {{form.username}} {{form.email}} //other fields And I want to set placeholders for each field. But this is a kind of built-in app. so I need to find the way for editing these fields from my main app. I don't want to change source of django-registration. If you can override the built-in form, you can define the placeholder as follows: class RegistrationForm(forms.ModelForm): class Meta: model = YourModelName widgets = { 'username' : forms.TextInput(attrs = {'placeholder': 'Username'}), 'email' : forms.TextInput

How to use different form in Django-Registration

萝らか妹 提交于 2019-12-03 13:25:31
Django-Registration has several form classes in the forms.py file. One is "class RegistrationFormTermsOfService(RegistrationForm) .. What do I change in the rest of Django Registration code to enable this form in my registration flow instead of RegistrationForm? Abid A You can simply go into your urls.py and override the form class by doing something like: from registration.forms import RegistrationFormTermsOfService (r'^accounts/register/$', 'registration.views.register', {'form_class' : RegistrationFormTermsOfService}), Updating the accepted answer to conform with Django 1.5 and the latest