Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.22 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Django and UnicodeDecodeError
  2. title = ' '.join([filename[:filename.rfind('.')], str(count)])
  3.        
  4. from django.utils.encoding import smart_str
  5.  
  6. title = ' '.join([smart_str(filename[:filename.rfind('.')]), str(count)])