tags:

views:

60

answers:

1

Hi,

I've moved my django application from one server to another, and spotted strange bug with media after it:

Traceback (most recent call last):

 File "/usr/lib/python2.5/site-
packages/Django-1.1.1-py2.5.egg/django/core/handlers/base.py", line 92, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/usr/lib/python2.5/site-packages/Django-1.1.1-py2.5.egg/django/views/static.py", line 51, in serve
   if os.path.isdir(fullpath):

 File "/usr/lib/python2.5/posixpath.py", line 195, in isdir
   st = os.stat(path)

UnicodeEncodeError: 'ascii' codec can't encode characters in position 44-46: ordinal not in range(128)

The image I am trying to access actually have Cyrillic symbols in the name, but it didn't made a problem on previous environment

Thanks, Oleg

A: 

First of all, don't have Django serve your static files. See this: http://docs.djangoproject.com/en/dev/howto/static-files/

Fred Larson
Lets stick to solving the problem.
ashchristopher
@ashchristopher: The problem may very well be using Django to do something it isn't well suited to do. Let the web server serve the static files, and the problem may go away.
Fred Larson
Its reasonable to want this working in a test server environment. Particularily to make it portable. Although this is a good, 'just get on with it' solution
michael
Actually it worked without any influence...Not sure what it was...
Oleg Tarasenko