title: Django How can i split string using template tag
body: <p>Hello I want to know that how can I split string of dictionary values</p>
  
  <p>This is my crawler which is returns dictionary data looks like</p>
  
  <pre><code>data = {
      {0:'http://..., product name, product price'},
      {1:'http://...2, product name2, product price2'},
      {N:'http://...2, product name2, product price n'}
  }
  </code></pre>
  
  <p>I want to split these data by comma 
   like, </p>
  
  <pre><code>for value in data.values():
       href, product_name, product_price = str(value).split(",")
  </code></pre>
  
  <p>in Django</p>
  
  <p>This is my crawler.py</p>
  
  <pre><code>import requests
  from urllib import parse
  from bs4 import BeautifulSoup
  
  
  def spider(item_name):
      url_item_name = parse.quote(item_name.encode('euc-kr'))
  
      url = 'http://search.11st.co.kr/SearchPrdAction.tmall?method=getTotalSearchSeller&amp;isGnb=Y&amp;prdType=&amp;category=&amp;cmd=&amp;pageSize=&amp;lCtgrNo=&amp;mCtgrNo=&amp;sCtgrNo=&amp;dCtgrNo=&amp;fromACK=recent&amp;semanticFromGNB=&amp;gnbTag=TO&amp;schFrom=&amp;schFrom=&amp;ID=&amp;ctgrNo=&amp;srCtgrNo=&amp;keyword=&amp;adUrl=&amp;adKwdTrcNo=&amp;adPrdNo=&amp;targetTab=T&amp;kwd=' + url_item_name
      resp = requests.get(url)
      resp.raise_for_status()
  
      resp.encoding='euc-kr'
      plain_text = resp.text
  
      soup = BeautifulSoup(plain_text, 'lxml')
      mytag = soup.find_all(True, {"class": ["sale_price", "list_info"]})
      #for link in soup.select('div.list_info p.info_tit a') :
      data = {}
      count = -1;
      for link in mytag:
          if(link.find('a')):
              count+=1
              href = link.find('a').get('href')
              product_name = link.find('a').string
              data[count] = str(href) + ", " + str(product_name)
          else:
              product_price = link.string
              if(product_price):
                  data[count] = data[count] +", " + str(product_price)
  
      for value in data.values():
          print(value)
      resp.close()
  
      return data
  </code></pre>
  
  <p>and this is my views</p>
  
  <pre><code>def post_shop_list(request):
      posts = spider("product name")
      return render(request, 'blog/post_list.html',{'posts' : posts})
  </code></pre>
  
  <p>and this is my post_list.html</p>
  
  <pre><code>{% for key, value in posts.items %}
      &lt;div&gt;
          &lt;td&gt;{{key}}&lt;/td&gt;
          &lt;p&gt;product name :{{value}}&lt;/p&gt;
          &lt;h1&gt;&lt;a href=href&gt; &lt;/a&gt;&lt;/h1&gt;
          &lt;p&gt;{{ product_price|linebreaksbr}}&lt;/p&gt;
      &lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <p>Thank you .. !!</p>