没有名为 backends.default.urls 的模块
所以我通过easy_install安装了django-registration。我正在遵循快速入门指南,并尝试设置我的 urlConf,但是它说找不到名为 backends.defauls.urls 的模块。可能是什么问题?
import registration
(r'^accounts/', include('registration.backends.default.urls')),
So I've installed django-registration through easy_install. I'm following a quick start guide and I'm trying to setup my urlConf, however it says module named backends.defauls.urls is not found. What might be the problem ?
import registration
(r'^accounts/', include('registration.backends.default.urls')),
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也有同样的问题。显然我尝试上传 urls.py 脚本的服务器有一个旧版本,我认为是 0.7。
我最初的解决方法是将 django-registration 作为应用程序(从源代码)并将其包含在 INSTALLED_APPS 中,并将注册文件夹放在我的其他应用程序旁边。
那么新的问题是在“自定义”应用程序之前查找已安装的版本,尤其是在导入时。例如,在views.py中,我们有一个
在0.7版本中似乎缺失的内容。因此,这会引发异常,但检查注册应用程序时,该函数是否位于registration/backend/init.py 中。
这会导致自定义注册应用程序(0.8)和服务器范围内安装的应用程序(0.7)之间发生冲突,我似乎无法解决这一问题。
I had the same problem. Apparently the server where I'm trying to upload the urls.py script has an older version, 0.7 I think.
My initial workaround was to put django-registration as an app (from the source) and include it in INSTALLED_APPS, with the registration folder right alongside my other apps.
Then the new problem was that the installed version is being looked up before the 'custom' app, especially on imports. For example, in views.py, we have an
which seems to be missing from the 0.7 version. So this raises an exception, but checking on the registration app the function is there in registration/backend/init.py.
This causes clashes between the custom registration app (0.8) and the one installed server-wide (0.7) that I can't seem to get around to.
(不是我的解决方案,但因为它隐藏在评论中)
您需要使用
include('registration.urls')
,而不是
include('registration.backends.default.urls ')
(not my solution, but since it was hidden in a comment)
You need to use use
include('registration.urls')
,instead of
include('registration.backends.default.urls')
注册模块是否在您的
PYTHONPATH
中?Is the registration module in your
PYTHONPATH
?我建议始终从 Bitbucket 获取 django 注册: https://bitbucket.org/ubernostrum/django -注册/概述。
我遇到了类似的问题,我使用 pip install 安装了 django-registration,但它没有给我最新的代码。
I'd suggest always getting django-registration from Bitbucket: https://bitbucket.org/ubernostrum/django-registration/overview.
I had a similar problem where I installed django-registration using pip install and it wasn't giving me up-to-date code.