IOError: Illegal Seek in django admin

32 views
Skip to first unread message

Andre P LeBlanc

unread,
Apr 5, 2011, 12:35:33 PM4/5/11
to 2degrees FLOSS
I'm using django 1.2.5, I've modified my wsgi handler to use
twod.wsgi's DjangoApplication, my site seems to work normally, until I
try to access the admin, when I get the following traceback:


Request Method: GET
Request URL: http://localhost/admin/
Django Version: 1.2.5
Python Version: 2.7.0
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs',
'django_openid_auth',
'debug_toolbar',
'djangoratings',
'xar.repository',
'taggit']
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 "/home/andre/env/lib/python2.7/site-packages/django/core/handlers/
base.py" in get_response
100. response = callback(request,
*callback_args, **callback_kwargs)
File "/home/andre/env/lib/python2.7/site-packages/django/contrib/admin/
sites.py" in wrapper
207. return self.admin_view(view, cacheable)(*args,
**kwargs)
File "/home/andre/env/lib/python2.7/site-packages/django/utils/
decorators.py" in _wrapped_view
76. response = view_func(request, *args,
**kwargs)
File "/home/andre/env/lib/python2.7/site-packages/django/views/
decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/home/andre/env/lib/python2.7/site-packages/django/contrib/admin/
sites.py" in inner
189. return self.login(request)
File "/home/andre/env/lib/python2.7/site-packages/django/views/
decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/home/andre/env/lib/python2.7/site-packages/django/contrib/admin/
sites.py" in login
305. if not request.POST.has_key(LOGIN_FORM_KEY):
File "/home/andre/env/lib/python2.7/site-packages/django/core/handlers/
wsgi.py" in _get_post
171. self._load_post_and_files()
File "/home/andre/env/lib/python2.7/site-packages/twod/wsgi/
handler.py" in _load_post_and_files
88. self._seek_input()
File "/home/andre/env/lib/python2.7/site-packages/twod/wsgi/
handler.py" in _seek_input
92. self.environ['wsgi.input'].seek(0)

Exception Type: IOError at /admin/
Exception Value: [Errno 29] Illegal seek

Gustavo Narea

unread,
Apr 6, 2011, 11:54:10 AM4/6/11
to 2degree...@googlegroups.com, Andre P LeBlanc
Hello, Andre.

It seems like Django Admin is reading the POST arguments in a GET
request, which it didn't do in Django 1.1.X.

I've committed a fix for that invalid operation in the "1.1" branch:
https://github.com/2degrees/twod.wsgi/commit/1bb3c92819ee38400d5a1613518551c4020173e3

I'm not comfortable releasing this to PYPI yet until it's undergone some
real world testing, which we will be carrying out as soon as support for
Django 1.2-1.3 is complete in a few days/couple of weeks (see:
https://github.com/2degrees/twod.wsgi/issues/#issue/2 ).

Thanks for reporting this!

- Gustavo.


--
Gustavo Narea.
Software Developer.
2degrees, Ltd. <http://dev.2degreesnetwork.com/>.

Reply all
Reply to author
Forward
0 new messages