title: How to get object by name in views.py django
body: <p>How to get object in views.py using name not by id.</p>
  <pre><code>def StockSummaryPage(request, title):
      stocks_data = get_object_or_404(Stock, string=title)
      return render(request, 'stocks/stock_summary_page.html', {'stocks_data':stocks_data})
  </code></pre>
  <p>This is my views.py and in</p>
  <blockquote>
  <p>stocks_data = get_object_or_404(Stock, string=title)</p>
  </blockquote>
  <p>we use pk= stock_id but i want to do it by title. So help me</p>