0

in this listview: context:

    context['first_item'] = obj_prods.filter(m_category=self.kwargs['m_category_id'],
 category=self.kwargs['category_id'], city=self.kwargs['city']).order_by('id').first()

in production: self.kwargs['city']: returning this: %d0%91%d0%b8%d1%88%d0%ba%d0%b5%d0%ba in template and in view, so filter is not working.

self.kwargs['m_category_id'] - is working as it as an integar.

but in localhost is working and returning string. Only in productions is not working as it as a string.

Any ideas what is going on?

Ural KG
  • 1
  • 1

1 Answers1

0

Found the answer to the problem:

Url decode UTF-8 in Python

from urllib.parse import unquote url = unquote(url)

so: unquote(self.kwargs['city']) !!!

Ural KG
  • 1
  • 1