追溯的含义是什么? [英] What is the meaning of the traceback?

查看:45
本文介绍了追溯的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用django-email-change-0.2.1只是为了更改auth_user-table中的emailadress.当我要在settings.py中添加应用程序emailchange时.我收到一条错误消息!

I am using django-email-change-0.2.1 just to change an emailadress in the auth_user-table. When I am going to add the app emailchange in the settings.py. I get an error message!

实际上,您可以安装该应用程序.但是我没有在python的站点包中这样做.我已将代码复制到网站的代码中.

Actually you can install the app. But I didn't do that in the site-packages of python. I have copied the code into my code of the website.

我的网站根目录:/trunk/网站/

Root of my Website: /trunk/website/

在以下路径中,我安装了不同的应用程序.路径:

In the following path I have installed different apps. Path:

/trunk/website/auth/user/emailchange  
/trunk/website/auth/user/registraiton  
/trunk/website/auth/user/profile

最后两个应用程序运行正常.我只想添加最后一个应用程序进行注册.要使用应用程序"emailchange"更改用户的电子邮件地址,因此我将在用户更改其电子邮件地址时发送验证链接.

The last two apps are working fine. I just want to add the last app for my registration. To change the email address of an user with the app "emailchange", so I am going to send a a verifaction link when the user is changeing his emailadress.

在我的settings.py中,以运行/安装我添加的应用程序(模型):

In my settings.py to run/install the app (model) I added:

Insalled_apps= {
'auth.user.emailchange'
}

但是,当我添加该应用程序并调用我网站的任何网站时,我会收到此错误消息!

But I am getting this errormessage when I add the app and call any site of my website!

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
  91.                         request.path_info)
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in resolve
  215.             for pattern in self.url_patterns:
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in _get_url_patterns
  244.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in _get_urlconf_module
  239.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/workspace/website/trunk/website/urls.py" in <module>
  5. admin.autodiscover()
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/__init__.py" in autodiscover
  24.             import_module('%s.admin' % app)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/trunk/website/auth/user/emailchange/admin.py" in <module>
  33. admin.site.register(cache.get_model('email_change', 'EmailChangeRequest'), EmailChangeRequestAdmin)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in register
  76.         for model in model_or_iterable:

Exception Type: TypeError at /start/
Exception Value: 'NoneType' object is not iterable

有什么想法吗?为什么收到此消息?

Any ideas? Why do I have this message?

推荐答案

此:

Insalled_apps= {
'auth.user.emailchange'
}

在很多方面都是错误的.首先,它不是有效的Python语法(花括号用于表示字典,而不是列表),其次,它甚至与将应用程序添加到Django settings.py文件中的有效方式也不尽相同,例如:

is wrong in many ways. First, it's not valid Python syntax (curly brackets are for making dicts, not lists) and secondly it's not even close to the valid way of adding an app to a Django settings.py file, which is something like:

INSTALLED_APPS = (
    'foos',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
 )

因此,基本上解决这些问题,然后再与我们联系.哦,您还可以考虑将代码复制并粘贴到问题中,以免再次输入时出错吗?

So basically fix those things and get back to us. Oh, and could you please also consider copying and pasting code into questions so you don't make mistakes typing them in again?

这篇关于追溯的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆