尝试导入AnonymousRequiredMixin时,使用virtualenv和django-braces导入错误

时间:2014-07-15 14:44:52

标签: python django virtualenv mod-wsgi

尝试运行时出现以下错误:

from braces.views import LoginRequiredMixin, PermissionRequiredMixin, AnonymousRequiredMixin

但是,在开发环境中一切正常,在我的生产环境中也是如此。django-braces位于virtualenv

是否有人遇到此错误或知道导致AnonymousRequiredMixin导致问题的原因?

[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]     url(r'', include('core.urls', namespace='core')),
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]   File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 25, in include
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]     urlconf_module = import_module(urlconf_module)
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]     __import__(name)
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]   File "/home/aaron/public_html/learnrealsql.com/asql/core/urls.py", line 3, in <module>
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]     from core import views
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]   File "/home/aaron/public_html/learnrealsql.com/asql/core/views.py", line 22, in <module>
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22]     from braces.views import LoginRequiredMixin, PermissionRequiredMixin, AnonymousRequiredMixin
[Tue Jul 15 14:36:08 2014] [error] [client 70.180.246.22] ImportError: cannot import name AnonymousRequiredMixin

修改

我正在使用:

Django 1.6.5
Python 3.3
django-braces 1.4.0

0 个答案:

没有答案