Sorry :( return HttpResponseRedirect(path) brings Internal Server Error:
cat /var/log/apache2/error.log [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] mod_wsgi (pid=6118): Exception occurred processing WSGI script '/var/www/filez/ apache/apache_django.wsgi'., referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] Traceback (most recent call last):, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ share/python-support/python-django/django/core/handlers/wsgi.py", line 246, in __call__, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] response = self.apply_response_fixes(request, response), referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ share/python-support/python-django/django/core/handlers/base.py", line 179, in apply_response_fixes, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] response = func(request, response), referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ share/python-support/python-django/django/http/utils.py", line 20, in fix_location_header, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] response ['Location'] = request.build_absolute_uri(response['Location']), referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ share/python-support/python-django/django/http/__init__.py", line 74, in build_absolute_uri, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] location = urljoin(current_uri, location), referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ lib/python2.6/urlparse.py", line 219, in urljoin, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] params, query, fragment)), referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ lib/python2.6/urlparse.py", line 184, in urlunparse, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] return urlunsplit((scheme, netloc, url, query, fragment)), referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] File "/usr/ lib/python2.6/urlparse.py", line 190, in urlunsplit, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] url = '//' + (netloc or '') + url, referer: http://172.16.23.33/alecs/ [Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 18: ordinal not in range(128), referer: http://172.16.23.33/alecs/ if I set return HttpResponseRedirect(path.encode('utf8')) then I'm getting: Environment: Request Method: GET Request URL: http://172.16.23.33/file/f5c27ee3982ebf701793038d22c72980d64793f566cb0ac10269ee0b Django Version: 1.0.3 Python Version: 2.6.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'filez.filezupload', 'debug_toolbar'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Traceback: File "/usr/share/python-support/python-django/django/core/handlers/ base.py" in get_response 91. response = callback(request, *callback_args, **callback_kwargs) File "/usr/share/python-support/python-django/django/contrib/auth/ decorators.py" in __call__ 78. return self.view_func(request, *args, **kwargs) File "/var/www/filez/filezupload/views.py" in send_file 256. return HttpResponseRedirect(path.encode('utf8')) Exception Type: UnicodeDecodeError at /file/ f5c27ee3982ebf701793038d22c72980d64793f566cb0ac10269ee0b Exception Value: ('ascii', '/var/upload/alecs/\xd0\xa6\xd0\xb5\xd0\xbb \xd0\xb5\xd0\xb2\xd1\x8b\xd0\xb5 \xd0\xbf\xd0\xbe\xd0\xba \xd0\xb0\xd0\xb7\xd0\xb0\xd1\x82\xd0\xb5\xd0\xbb\xd0\xb8 \xd0\xb4\xd0\xb5\xd1\x8f\xd1\x82\xd0\xb5\xd0\xbb\xd1\x8c\xd0\xbd \xd0\xbe\xd1\x81\xd1\x82\xd0\xb8 \xd0\xbd\xd0\xb0 2008 \xd0\xb3\xd0\xbe \xd0\xb4.jpg', 18, 19, 'ordinal not in range(128)') --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---