没有名为 backends.default.urls 的模块

发布于 2024-10-04 18:16:32 字数 229 浏览 4 评论 0原文

所以我通过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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

遮了一弯 2024-10-11 18:16:33

我也有同样的问题。显然我尝试上传 urls.py 脚本的服务器有一个旧版本,我认为是 0.7。

我最初的解决方法是将 django-registration 作为应用程序(从源代码)并将其包含在 INSTALLED_APPS 中,并将注册文件夹放在我的其他应用程序旁边。

那么新的问题是在“自定义”应用程序之前查找已安装的版本,尤其是在导入时。例如,在views.py中,我们有一个

from registration.backends import get_backend

在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

from registration.backends import get_backend

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.

笑红尘 2024-10-11 18:16:32

(不是我的解决方案,但因为它隐藏在评论中)

您需要使用 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')

春风十里 2024-10-11 18:16:32

注册模块是否在您的 PYTHONPATH 中?

Is the registration module in your PYTHONPATH?

猫烠⑼条掵仅有一顆心 2024-10-11 18:16:32

我建议始终从 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文