在 2012年4月23日星期一UTC+8上午11时51分18秒,BFSchott写道:
--This should work:# django-guardian requires an anonymous userANONYMOUS_USER_ID = -1Also, I think you need to "python manage.py syncdb" the first time you use it.On Apr 22, 2012, at 11:41 PM, su wrote:I set ANONYMOUS_USER_ID in my project setting.It doesn't work.Error message:-----------------------Traceback (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_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/__init__.py", line 252, in fetch_command app_name = get_commands()[subcommand]File "/usr/local/lib/python2.7/dist-packages/django/core/ management/__init__.py", line 101, in get_commands apps = settings.INSTALLED_APPSFile "/usr/local/lib/python2.7/dist-packages/django/utils/ functional.py", line 184, in inner self._setup()File "/usr/local/lib/python2.7/dist-packages/django/conf/__ init__.py", line 42, in _setup self._wrapped = Settings(settings_module)File "/usr/local/lib/python2.7/dist-packages/django/conf/__ init__.py", line 93, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python2.7/dist-packages/django/utils/ importlib.py", line 35, in import_module __import__(name)File "/home/su/document/django/simpleSNS/simpleSNS/settings. py", line 8, in <module> from userena.models import UserenaBaseProfileFile "/usr/local/lib/python2.7/dist-packages/userena/models. py", line 12, in <module> from userena.managers import UserenaManager, UserenaBaseProfileManagerFile "/usr/local/lib/python2.7/dist-packages/userena/ managers.py", line 11, in <module> from guardian.shortcuts import assign, get_permsFile "/usr/local/lib/python2.7/dist-packages/guardian/ shortcuts.py", line 9, in <module> from guardian.core import ObjectPermissionCheckerFile "/usr/local/lib/python2.7/dist-packages/guardian/core. py", line 7, in <module> from guardian.utils import get_identityFile "/usr/local/lib/python2.7/dist-packages/guardian/utils. py", line 11, in <module> from guardian.conf.settings import ANONYMOUS_USER_IDFile "/usr/local/lib/python2.7/dist-packages/guardian/conf/ settings.py", line 6, in <module> raise ImproperlyConfigured("In order to use django-guardian's "django.core.exceptions.ImproperlyConfigured: In order to use django-guardian's ObjectPermissionBackend authorization backend you have to configure ANONYMOUS_USER_ID at your settings module --
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ .BY1w2ckqa34J
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com .
For more options, visit this group at http://groups.google.com/group/django-users?hl=en .
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Uy_8FQThbp0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment