thanks I resolve that issue,
seems the parameter miss a 'e'.
On Tue, Feb 19, 2013 at 3:15 PM, Zhao Quan <felixz2010@gmail.com> wrote:
thanks Pankaj for replay my question so quickly. :)I already add this code in models.pycode 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 Userfrom django.utils.translation import ugettext as _from userena.models import UserenaBaseProfileclass 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 ZhaoOn Tue, Feb 19, 2013 at 3:10 PM, Pankaj Singh <ps.jinx@gmail.com> wrote:
Hey,You need to import UserenaBaseProfile in your models.py before defining MyProfile class.--from userena.models import UserenaBaseProfilehttp://docs.django-userena.org/en/latest/installation.html#profiles
On Tue, Feb 19, 2013 at 12:36 PM, Zhao Quan <felixz2010@gmail.com> 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.I get exception like this: NameError: name 'UsernaBaseProfile' is not defined------------------------detial info as below ---------------------------------
~/djcode/mysite$ ./manage.py check_permissionsTraceback (most recent call last):File "./manage.py", line 10, in <module>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_lineutility.execute()File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in executeself.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_argvself.execute(*args, **options.__dict__)File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 231, in executeself.validate()File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validatenum_errors = get_validation_errors(s, app)File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errorsfor (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_errorsself._populate()File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populateself.load_app(app_name, True)File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_appmodels = 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 <module>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+unsubscribe@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+unsubscribe@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+unsubscribe@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 comments:
Post a Comment