django-registration

Django-Registration: Email as username

陌路散爱 提交于 2019-12-03 00:29:47
问题 How do I use emails instead of username for authentication using django-registration. Further how do I enforce this change once I have already installed the registration module. Do I edit the solution here Anyone knows a good hack to make django-registration use emails as usernames? in the lib folder? 回答1: Dear fellow Django Coder, I think this is the best way to do it. Good luck! First step, is to create the form you'd like to use . project/accounts/forms.py from django import forms from

Getting `django-registration` to send you to the page you were originally trying to visit

拜拜、爱过 提交于 2019-12-02 21:06:38
django.contrib.auth has an awesome feature: When you try to access a page that's decorated by login_required , you get redirected to the login page with a next argument, so after you login you get redirected back to the page you were originally trying to access. That's good for the user flow. But, apparently django-registration does not provide a similar feature. I expected that if you register instead of login, you would also get a next thing, and after registering-n'-activating you'll get redirected to the page you were originally trying to visit. This is not the case, you're just redirected

django-registration “remember me”

核能气质少年 提交于 2019-12-02 20:55:46
I need to implement a "Remember me" button in a login form that uses the django-registration app. Any ane can help me showing me the way for do this? Thanks One way to do it is to change the session expiration date. This snippet gives an example: http://www.djangosnippets.org/snippets/1881/ Apparently, there's module for that: http://code.google.com/p/django-remember-me/ I haven't used it but it came up during my search. 来源: https://stackoverflow.com/questions/2770370/django-registration-remember-me

Django 1.6 and django-registration: built-in authentication views not picked up

痞子三分冷 提交于 2019-12-02 20:36:39
I am trying to upgrade my webapp from Django 1.5 to Django 1.6 and as part of my set of django apps I am using django-registration 1.0 . After upgrading to Django 1.6 my app does not recognize the built-in authentication views any more. They are integrated in django registration as can be seen here , but they stopped working. The Django release notes describe a change in the way these views should be integrated , when comparing that to the source code in the registration-app that looks fine. I am introducing the registration urls as follows: urlpatterns = patterns('', ..., url(r'^accounts/',

Django:How can I prevent authenticated user from both register and login page in Django-registration-redux

我们两清 提交于 2019-12-02 19:23:55
问题 I am currently using Django-registration-redux for my authentication system. Already logged in user can visit the login and registration page again; which is not good enough. How can I prevent them from this since the views.py comes by default in Django-registration-redux I think that should be done in the views.py that come with Django-registration-redux Here is the views.py """ Views which allow users to create and activate accounts. """ from django.shortcuts import redirect from django

Django-Registration: Email as username

情到浓时终转凉″ 提交于 2019-12-02 14:06:54
How do I use emails instead of username for authentication using django-registration . Further how do I enforce this change once I have already installed the registration module. Do I edit the solution here Anyone knows a good hack to make django-registration use emails as usernames? in the lib folder? Dear fellow Django Coder, I think this is the best way to do it. Good luck! First step, is to create the form you'd like to use . project/accounts/forms.py from django import forms from registration.forms import RegistrationForm from django.contrib.auth.models import User class Email(forms

why doesn't work registration user?

喜夏-厌秋 提交于 2019-12-02 12:29:28
i can't registration of user work, just relog the page, someone can help me form.py class RegistroUserForm(forms.Form): username = forms.CharField(min_length=5,widget=forms.TextInput(attrs={'class': 'form-control'})) email = forms.EmailField(widget=forms.EmailInput(attrs={'class': 'form-control'})) password = forms.CharField(min_length=5,widget=forms.PasswordInput(attrs={'class': 'form-control'})) password2 = forms.CharField(min_length=5,widget=forms.PasswordInput(attrs={'class': 'form-control'})) def clean_username(self): """Comprueba que no exista un username igual en la db""" username =

get_success_url() takes exactly 3 arguments (2 given)

China☆狼群 提交于 2019-12-02 12:14:49
every one ,, I am using django-registration-redux (1.4) for my django registration(django 1.8),,however ,,when never I registered the web will show the error ,,but the views.py in form_valid, line 43 it is the editing function,,it seems not about the register?? views.py @login_required def edit_thing(request, slug): # grab the object... thing = ProductsTbl.objects.get(slug=slug) if thing.user != request.user: raise Http404 # set the form we're using... form_class = ProductsTblForm if request.method == 'POST': # grab the data from the submitted form form = form_class(data=request.POST,files

Django 1.8+ extending the User model

放肆的年华 提交于 2019-12-02 04:40:35
I know this question has been asked hundreds of times, but most of them contain -accepted- answers that are not valid anymore. Some of them are for Django 1.5, some of them are even older. So I'm looking for an up-to-date answer. The question that most resembles my problem is this one . I'm using the django-registration module and I want users to have additional fields (like integer user.points ). I'm OK with implementing my own MyUser model and changing the rest of my program accordingly. However I doubt this will work in compliance with the registration module. So I guess the ideal way would

Django-Registration Activation redirect with django.contrib.messages

試著忘記壹切 提交于 2019-12-01 11:32:12
I'm trying to set up my django-registration activation workflow so that when the user hits the activation link it redirects them to the login page with a nice little message using the django messages framework django.contrib.messages Right now, I've managed to send the user back to the homepage using the success_url parameter: url(r'activate/(?P<activation_key>\w+)/$', activate, {'backend': 'registration.backends.default.DefaultBackend', 'success_url':'/'}, name='registration_activate', ), where '/' is the home login view. I need to set the success message somewhere along the way...perhaps