Re: Finding a project for django user registration

2013-02-05 Thread Zhao Quan
Thanks Ezequiel

Im trying this.


On Wed, Feb 6, 2013 at 10:08 AM, Ezequiel  wrote:

> On Tuesday, February 5, 2013 10:52:19 PM UTC-3, Zhao Quan wrote:
>
>> at last, I find this one
>> https://github.com/**nathanborror/django-**registration<https://github.com/nathanborror/django-registration>
>>
>> but, seems it create in 3 years later and no update in current.
>> Is there any suggest for is issue?
>>
>>
> Check out https://github.com/bread-and-pepper/django-userena. Seems very
> nice.
>
> Ezequiel,
> http://flickrock.com/mikelpierre
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Finding a project for django user registration

2013-02-05 Thread Zhao Quan
hi all when I trying 'userena', I get the exception which is
"siteprofilenotavailable"

I do some google at first,

some one suggest upgrade django.
but I use the latest version of django.

interesting thing is I find this topic.
https://github.com/bread-and-pepper/django-userena/issues/153
the creator closed topic which same issue to me.

BTW, I have checked my spell.

many thanks for all.


On Wed, Feb 6, 2013 at 12:25 PM, Zhao Quan  wrote:

> Thanks Ezequiel
>
> Im trying this.
>
>
> On Wed, Feb 6, 2013 at 10:08 AM, Ezequiel  wrote:
>
>> On Tuesday, February 5, 2013 10:52:19 PM UTC-3, Zhao Quan wrote:
>>
>>> at last, I find this one
>>> https://github.com/**nathanborror/django-**registration<https://github.com/nathanborror/django-registration>
>>>
>>>  but, seems it create in 3 years later and no update in current.
>>> Is there any suggest for is issue?
>>>
>>>
>> Check out https://github.com/bread-and-pepper/django-userena. Seems very
>> nice.
>>
>> Ezequiel,
>> http://flickrock.com/mikelpierre
>>
>> --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[no subject]

2013-02-18 Thread Zhao Quan
Hi all,

I fish for django.
So, I want to use some code to handle use login and registion issue.
I find the code name "django-userena"

But, after I follow the guide to setup.
http://docs.django-userena.org/en/latest/installation.html
I get exception like this: NameError: name 'UsernaBaseProfile' is not
defined

detial info as below
-

~/djcode/mysite$ ./manage.py check_permissions
Traceback (most recent call last):
  File "./manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 443, in execute_from_command_line
utility.execute()
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 231, in execute
self.validate()
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 266, in validate
num_errors = get_validation_errors(s, app)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
158, in get_app_errors
self._populate()
  File
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
64, in _populate
self.load_app(app_name, True)
  File
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
88, in load_app
models = import_module('.models', app_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
  File "/home/quanzhao/djcode/mysite/accounts/models.py", line 8, in

class MyProfile(UsernaBaseProfile):
NameError: name 'UsernaBaseProfile' is not defined

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re:

2013-02-18 Thread Zhao Quan
thanks Pankaj for replay my question so quickly. :)

I already add this code in models.py
code as below.
I place it under path "mysite/accounts/models.py"
models.py
from django.db import models

# Create your models here.
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile

class MyProfile(UsernaBaseProfile):
  user = models.OneToOneField(User,
  unique=True,
  verbose_name=_('user'),
  related_name='my_profile')
  favourite_snack = models.CharField(_('favourite snack'),
 max_length=5)

So many thanks for u,
Felix Zhao


On Tue, Feb 19, 2013 at 3:10 PM, Pankaj Singh  wrote:

> Hey,
>
> You need to import UserenaBaseProfile in your models.py before defining
> MyProfile class.
>
> from userena.models import UserenaBaseProfile
>
> http://docs.django-userena.org/en/latest/installation.html#profiles
>
> Sincerely,
> Pankaj Singh
> http://about.me/psjinx
>
>
> On Tue, Feb 19, 2013 at 12:36 PM, Zhao Quan  wrote:
>
>> Hi all,
>>
>> I fish for django.
>> So, I want to use some code to handle use login and registion issue.
>> I find the code name "django-userena"
>>
>> But, after I follow the guide to setup.
>> http://docs.django-userena.org/en/latest/installation.html
>>  I get exception like this: NameError: name 'UsernaBaseProfile' is not
>> defined
>>
>> detial info as below
>> -
>>
>> ~/djcode/mysite$ ./manage.py check_permissions
>> Traceback (most recent call last):
>>   File "./manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 443, in execute_from_command_line
>> utility.execute()
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 382, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 196, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 231, in execute
>> self.validate()
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 266, in validate
>> num_errors = get_validation_errors(s, app)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
>> line 30, in get_validation_errors
>> for (app_name, error) in get_app_errors().items():
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>> 158, in get_app_errors
>> self._populate()
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>> 64, in _populate
>> self.load_app(app_name, True)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>> 88, in load_app
>> models = import_module('.models', app_name)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
>> 35, in import_module
>> __import__(name)
>>   File "/home/quanzhao/djcode/mysite/accounts/models.py", line 8, in
>> 
>> class MyProfile(UsernaBaseProfile):
>> NameError: name 'UsernaBaseProfile' is not defined
>>
>>  --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re:

2013-02-18 Thread Zhao Quan
thanks I resolve that issue,
seems the parameter miss a 'e'.


On Tue, Feb 19, 2013 at 3:15 PM, Zhao Quan  wrote:

> thanks Pankaj for replay my question so quickly. :)
>
> I already add this code in models.py
> code as below.
> I place it under path "mysite/accounts/models.py"
>
> models.py
> from django.db import models
>
> # Create your models here.
> from django.contrib.auth.models import User
> from django.utils.translation import ugettext as _
> from userena.models import UserenaBaseProfile
>
> class MyProfile(UsernaBaseProfile):
>   user = models.OneToOneField(User,
>   unique=True,
>   verbose_name=_('user'),
>   related_name='my_profile')
>   favourite_snack = models.CharField(_('favourite snack'),
>  max_length=5)
>
> So many thanks for u,
> Felix Zhao
>
>
> On Tue, Feb 19, 2013 at 3:10 PM, Pankaj Singh  wrote:
>
>> Hey,
>>
>> You need to import UserenaBaseProfile in your models.py before defining
>> MyProfile class.
>>
>> from userena.models import UserenaBaseProfile
>>
>> http://docs.django-userena.org/en/latest/installation.html#profiles
>>
>> Sincerely,
>> Pankaj Singh
>> http://about.me/psjinx
>>
>>
>> On Tue, Feb 19, 2013 at 12:36 PM, Zhao Quan  wrote:
>>
>>> Hi all,
>>>
>>> I fish for django.
>>> So, I want to use some code to handle use login and registion issue.
>>> I find the code name "django-userena"
>>>
>>> But, after I follow the guide to setup.
>>> http://docs.django-userena.org/en/latest/installation.html
>>>  I get exception like this: NameError: name 'UsernaBaseProfile' is not
>>> defined
>>>
>>> detial info as below
>>> -
>>>
>>> ~/djcode/mysite$ ./manage.py check_permissions
>>> Traceback (most recent call last):
>>>   File "./manage.py", line 10, in 
>>> execute_from_command_line(sys.argv)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>>> line 443, in execute_from_command_line
>>> utility.execute()
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>>> line 382, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>>> line 196, in run_from_argv
>>> self.execute(*args, **options.__dict__)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>>> line 231, in execute
>>> self.validate()
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>>> line 266, in validate
>>> num_errors = get_validation_errors(s, app)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
>>> line 30, in get_validation_errors
>>> for (app_name, error) in get_app_errors().items():
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>>> 158, in get_app_errors
>>> self._populate()
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>>> 64, in _populate
>>> self.load_app(app_name, True)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>>> 88, in load_app
>>> models = import_module('.models', app_name)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
>>> 35, in import_module
>>> __import__(name)
>>>   File "/home/quanzhao/djcode/mysite/accounts/models.py", line 8, in
>>> 
>>> class MyProfile(UsernaBaseProfile):
>>> NameError: name 'UsernaBaseProfile' is not defined
>>>
>>>  --
>>> 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 dja

Re:

2013-02-19 Thread Zhao Quan
Thanks Pankaj.

Its my typo issue.


On Tue, Feb 19, 2013 at 3:25 PM, Pankaj Singh  wrote:

> Right. 'UsernaBaseProfile' should be 'UserenaBaseProfile'.
>
>
> Sincerely,
> Pankaj Singh
> http://about.me/psjinx
>
>
> On Tue, Feb 19, 2013 at 12:53 PM, Zhao Quan  wrote:
>
>> thanks I resolve that issue,
>> seems the parameter miss a 'e'.
>>
>>
>> On Tue, Feb 19, 2013 at 3:15 PM, Zhao Quan  wrote:
>>
>>> thanks Pankaj for replay my question so quickly. :)
>>>
>>> I already add this code in models.py
>>> code as below.
>>> I place it under path "mysite/accounts/models.py"
>>>
>>> models.py
>>> from django.db import models
>>>
>>> # Create your models here.
>>> from django.contrib.auth.models import User
>>> from django.utils.translation import ugettext as _
>>> from userena.models import UserenaBaseProfile
>>>
>>> class MyProfile(UsernaBaseProfile):
>>>   user = models.OneToOneField(User,
>>>   unique=True,
>>>   verbose_name=_('user'),
>>>   related_name='my_profile')
>>>   favourite_snack = models.CharField(_('favourite snack'),
>>>  max_length=5)
>>>
>>> So many thanks for u,
>>> Felix Zhao
>>>
>>>
>>> On Tue, Feb 19, 2013 at 3:10 PM, Pankaj Singh  wrote:
>>>
>>>> Hey,
>>>>
>>>> You need to import UserenaBaseProfile in your models.py before defining
>>>> MyProfile class.
>>>>
>>>> from userena.models import UserenaBaseProfile
>>>>
>>>> http://docs.django-userena.org/en/latest/installation.html#profiles
>>>>
>>>> Sincerely,
>>>> Pankaj Singh
>>>> http://about.me/psjinx
>>>>
>>>>
>>>> On Tue, Feb 19, 2013 at 12:36 PM, Zhao Quan wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I fish for django.
>>>>> So, I want to use some code to handle use login and registion issue.
>>>>> I find the code name "django-userena"
>>>>>
>>>>> But, after I follow the guide to setup.
>>>>> http://docs.django-userena.org/en/latest/installation.html
>>>>>  I get exception like this: NameError: name 'UsernaBaseProfile' is not
>>>>> defined
>>>>>
>>>>> detial info as below
>>>>> -
>>>>>
>>>>> ~/djcode/mysite$ ./manage.py check_permissions
>>>>> Traceback (most recent call last):
>>>>>   File "./manage.py", line 10, in 
>>>>> execute_from_command_line(sys.argv)
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>>>>> line 443, in execute_from_command_line
>>>>> utility.execute()
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>>>>> line 382, in execute
>>>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>>>>> line 196, in run_from_argv
>>>>> self.execute(*args, **options.__dict__)
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>>>>> line 231, in execute
>>>>> self.validate()
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>>>>> line 266, in validate
>>>>> num_errors = get_validation_errors(s, app)
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
>>>>> line 30, in get_validation_errors
>>>>> for (app_name, error) in get_app_errors().items():
>>>>>   File
>>>>> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
>>>>> 158, in get_app_errors
>>>>> self._populate()
>>&g

A question for encoding issue when I read file by python

2013-06-30 Thread Zhao Quan
Hi all,

when I try to read a file which actual encoding is gbk.

I get exception as below:
--
Traceback (most recent call last):
  File "", line 1, in 
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py",
line 675, in readline
return self.reader.readline(size)
UnicodeDecodeError: 'gb2312' codec can't decode bytes in position 0-1:
illegal multibyte sequence
--

here is my code:
--
>>> import codecs
>>> f = codecs.open('namelist.txt',encoding='gb2312')
>>> f.readline()
--

Data example:
--
曹星 iamcaoyuxin
--

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.