命令被忽略,直到事务结束,块当前事务被中止

时间:2012-11-28 02:34:47

标签: django

当我尝试通过Django-registration插件向应用程序注册帐户时,Django一直在抛出错误。我可以毫无问题地与其他模型进行crud操作。

我的环境: Postgresql 8.4 Django 1.4.2

  

环境:

     

请求方法:POST请求URL:   本地主机:8000 /账户/注册/

     

Django版本:1.4.2 Python版本:2.7.3已安装的应用程序:   ('django.contrib.auth','django.contrib.contenttypes',   'django.contrib.sessions','django.contrib.sites',   'django.contrib.messages','django.contrib.staticfiles',   'django.contrib.admin','django.contrib.humanize',   'django.contrib.gis','django.contrib.staticfiles','south',   'dirapp','registration','django_extensions','sorl.thumbnail',   'debug_toolbar')已安装的中间件:   ( 'django.middleware.common.CommonMiddleware',   'django.contrib.sessions.middleware.SessionMiddleware',   'django.middleware.csrf.CsrfViewMiddleware',   'django.contrib.auth.middleware.AuthenticationMiddleware',   'django.contrib.messages.middleware.MessageMiddleware',   'debug_toolbar.middleware.DebugToolbarMiddleware')

     

回溯:文件   “/root/env27/lib/python2.7/site-packages/django/core/handlers/base.py”   在get_response中     111. response = callback(request,* callback_args,** callback_kwargs)文件“/root/posguide/registration/views.py”的注册表     187. new_user = backend.register(request,** form.cleaned_data)文件“/root/posguide/registration/backends/default/init.py”的注册表     79.密码,网站)文件   “/root/env27/lib/python2.7/site-packages/django/db/transaction.py”in   内     209.在create_inactive_user中返回func(* args,** kwargs)文件“/root/posguide/registration/models.py”     78. new_user = User.objects.create_user(用户名,电子邮件,密码)文件   “/root/env27/lib/python2.7/site-packages/django/contrib/auth/models.py”   在create_user中     160. user.save(using = self._db)文件“/root/env27/lib/python2.7/site-packages/django/db/models/base.py”in   保存     463. self.save_base(using = using,force_insert = force_insert,force_update = force_update)File   “/root/env27/lib/python2.7/site-packages/django/db/models/base.py”in   save_base     565. created =(not record_exists),raw = raw,using = using)File   “/root/env27/lib/python2.7/site-packages/django/dispatch/dispatcher.py”   发送     172. response = receiver(signal = self,sender = sender,** named)create_user_profile中的文件“/root/posguide/dirapp/views.py”     154. UserProfile.objects.create(user = instance)File“/root/env27/lib/python2.7/site-packages/django/db/models/manager.py”   在创造     137. return self.get_query_set()。create(** kwargs)File“/root/env27/lib/python2.7/site-packages/django/db/models/query.py”in   创建     377. obj.save(force_insert = True,using = self.db)文件“/root/env27/lib/python2.7/site-packages/django/db/models/base.py”in   保存     463. self.save_base(using = using,force_insert = force_insert,force_update = force_update)File   “/root/env27/lib/python2.7/site-packages/django/db/models/base.py”in   save_base     551. result = manager._insert([self],fields = fields,return_id = update_pk,using = using,raw = raw)文件   “/root/env27/lib/python2.7/site-packages/django/db/models/manager.py”   在_insert中     203. return insert_query(self.model,objs,fields,** kwargs)文件   “/root/env27/lib/python2.7/site-packages/django/db/models/query.py”in   insert_query     1593. return query.get_compiler(using = using).execute_sql(return_id)File   “/root/env27/lib/python2.7/site-packages/django/db/models/sql/compiler.py”   在execute_sql中     910. cursor.execute(sql,params)

     

异常类型:/ accounts / register / Exception值的InternalError:   当前事务被中止,命令被忽略直到结束   交易块

0 个答案:

没有答案