0

我目前正在开发一个使用 mongoengine 和 django 的项目。我正在使用 django-registration-me 来处理用户注册,但是在提交新的用户注册表单后我遇到了问题。

我收到的错误是:

“ViewDoesNotExist at /accounts/register/” “在模块 core.views 中尝试设置。错误是:‘模块’对象没有属性‘设置’”

不过,它会发送一封验证电子邮件。我是 django 和 mongoengine 的新手,因此我们将不胜感激。

回溯如下。

环境:

请求方式:POST 请求网址: http ://dev.teamfit.us:8000/accounts/register/

Django 版本:1.3 beta 1 SVN-15207

Python版本:2.6.6

已安装的应用程序:['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages',
'registration']

已安装的中间件:('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django .contrib.messages.middleware.MessageMiddleware')

追溯:

get_response 111 中的文件“/usr/src/django-trunk/django/core/handlers/base.py”。 response = callback(request, *callback_args, **callback_kwargs)

寄存器 153 中的文件“/usr/local/lib/python2.6/dist-packages/django_registration_me-0.7-py2.6.egg/registration/views.py”。返回 HttpResponseRedirect(success_url 或 reverse('registration_complete'))

反向文件“/usr/src/django-trunk/django/core/urlresolvers.py” 390. *args, **kwargs)))

反向 311 中的文件“/usr/src/django-trunk/django/core/urlresolvers.py”。可能性 = self.reverse_dict.getlist(lookup_view)

_get_reverse_dict 228 中的文件“/usr/src/django-trunk/django/core/urlresolvers.py”。self._populate()

_populate 219 中的文件“/usr/src/django-trunk/django/core/urlresolvers.py”。lookups.appendlist(pattern.callback, (bits, p_pattern))

_get_callback 169 中的文件“/usr/src/django-trunk/django/core/urlresolvers.py”. raise ViewDoesNotExist("Tried %s in module %s. Error was: %s" % (func_name, mod_name, str(e )))

异常类型:/accounts/register/ 处的 ViewDoesNotExist

异常值:模块 core.views 中的尝试设置。错误是:“模块”对象没有属性“设置”

4

1 回答 1

0

我猜,你有

导入设置

或您的代码中的一些此类变化。

您应该将其更改为:

from django.conf import settings

它应该可以工作

于 2011-02-03T06:44:33.077 回答