I use django 1.6.1 and python 3.3.3 in windows8. I want to build a app 
named 'customauth' that supports email activation. I choose to create my 
own user model from the django.contrib.auth.models.AbstractBaseUser , not a 
profile model that holds a OneToOneField to django build-in User model.

This model class is called 'MyUser'.Its features:

1. Only three fields : email, username and password are required when 
creating an MyUser instance.

2. User logins my site via email and password.

3. When creating a user (not superuser), field 'is_active' is False, 
'activation_key' is set to a random key with username, then, djanog sends 
an email with a activation_key link to him. If user clicks it in some days 
(like 3), his 'is_active' turns True,  'activation_key' turns to be a 
constant , so he can login.

4.When creating a superuser, its 'is_active' is True, 'activation_key' is a 
constant directly and not invoking the process of sending activation email.

Up to now, what I have done looks like a weird combination of a custom User 
model from Substituting a custom User model 
<https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#auth-custom-user>and
 
the theory from 
django-registration<https://bitbucket.org/ubernostrum/django-registration/wiki/Home>
.

Now my situation is weird:

1.Only when 'python manage.py syncdb' in cmd.exe, creating the superuser, 
the whole process can work fine (i.e.,send a mail, then click it to 
activate). However, this superuser can not login admin site despite its 
'is_admin' is True. It can only login user site.
https://www.dropbox.com/s/1l8f78fgfj4696a/super.jpg

2.When you register a user in the normal way (you enter some required 
infomation in the form), the user can be created, but django will not send 
a email to this user.

Now I donot know the reason, but as the email activation system works fine 
when first creating the superuser, there must be a way to make it works in 
user register.

So, what should I do, Thanks.

This is the project file 
myauth.zip<https://www.google.com/url?q=https%3A%2F%2Fwww.dropbox.com%2Fs%2Fke47wspiskz2nel%2Fmyauth.zip&sa=D&sntz=1&usg=AFQjCNEH6BxEpSA6NOI2O24qjwcrHzaNbw>,
 
if needed.'customauth' is the app.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed7f7396-ac88-476a-a745-c74a7e612dcd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to