Skip to content

Instantly share code, notes, and snippets.

@itsderek23
Created August 24, 2018 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsderek23/997a59d28288f9ec970ebf22c1117b03 to your computer and use it in GitHub Desktop.
Save itsderek23/997a59d28288f9ec970ebf22c1117b03 to your computer and use it in GitHub Desktop.
# views.py
except EmptyPage:
search_results = paginator.page(paginator.num_pages)
+ scout_apm.api.Context.add("search_query",search_query)
+ scout_apm.api.Context.add("search_results_size",len(search_results))
return render(request, 'search/search_results.html', {
'search_query': search_query,
'search_results': search_results,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment