2π
β
uβ just means that the string is shown in unicode. Default encoding in django is unicode. Donβt bother too much with uβ, the actual result will always be the string between the single quotes.
For more info, look here. http://docs.djangoproject.com/en/dev/ref/unicode/
So the error that you are getting is possible if types in query do not match. So instead of
message = '%s' % q
try
message = str(q)
or
message = int(q)
as may be applicable.
π€Neo
Source:stackexchange.com