“不良元帅数据” Django开发服务器错误 [英] "Bad marshal data" Django development server error

查看:61
本文介绍了“不良元帅数据” Django开发服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将数据插入到我的MySQL数据库中时遇到此错误

Got this error while insterting data into my MySQL database

ValueError at /admin/arbkdb/arbkcompany/
bad marshal data (unknown type code)
Request Method: GET
Request URL:    http://[2001:6f8:1c00:18b::2]:9000/admin/arbkdb/arbkcompany/
Django Version: 1.3
Exception Type: ValueError
Exception Value:    
bad marshal data (unknown type code)
Exception Location: /usr/lib/python2.7/dist-packages/simplejson/__init__.py in <module>, line 111
Python Executable:  /usr/bin/python
Python Version: 2.7.2
Python Path:    
['/home/ardian/.experiments/arbk',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
Server time:    Tue, 8 May 2012 16:15:19 -050



引用



Trackback

Environment:


Request Method: GET
Request URL: http://[2001:6f8:1c00:18b::2]:9000/admin/arbkdb/arbkcompany/

Django Version: 1.3
Python Version: 2.7.2
Installed Applications:
['admin_tools',
 'admin_tools.theming',
 'admin_tools.menu',
 'admin_tools.dashboard',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'arbkdb',
 'south',
 'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py" in get_response
  89.                     response = middleware_method(request)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/middleware.py" in process_request
  11.         request._messages = default_storage(request)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/__init__.py" in <lambda>
  31. default_storage = lambda request: get_storage(settings.MESSAGE_STORAGE)(request)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/__init__.py" in get_storage
  17.         mod = import_module(module)
File "/usr/lib/pymodules/python2.7/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/user_messages.py" in <module>
  8. from django.contrib.messages.storage.fallback import FallbackStorage
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/fallback.py" in <module>
  2. from django.contrib.messages.storage.cookie import CookieStorage
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/cookie.py" in <module>
  5. from django.utils import simplejson as json
File "/usr/lib/pymodules/python2.7/django/utils/simplejson/__init__.py" in <module>
  111.     import simplejson
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py" in <module>
  111. from decoder import JSONDecoder, JSONDecodeError

Exception Type: ValueError at /admin/arbkdb/arbkcompany/
Exception Value: bad marshal data (unknown type code)

Ps。我不确定如何描述此错误的原因,因为它在插入大量数据时出现,我不知道为什么。

Ps. I am not sure how to describe why it came to this error because it appeard while inserting a lot of data and I don't know why

这是我的模型数据b $ b https://github.com/ardian/arbk/blob/ master / arbkdb / models.py

This is my model data https://github.com/ardian/arbk/blob/master/arbkdb/models.py

推荐答案

看起来不是数据库问题,而是文件损坏消息。删除* .pyc和* .pyo文件可以解决此问题。

Looks like is not a database problem but a corrupted files message. Removing *.pyc and *.pyo files solves this.

这篇关于“不良元帅数据” Django开发服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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