Skip to content

Instantly share code, notes, and snippets.

@LowerDeez
Created October 1, 2018 09:06
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 LowerDeez/e0980435b482e1f19dba9302d32c12c9 to your computer and use it in GitHub Desktop.
Save LowerDeez/e0980435b482e1f19dba9302d32c12c9 to your computer and use it in GitHub Desktop.
Django. Remove GET parameters with specific prefix from querystring
qs = request.META.get('QUERY_STRING', '')
querystring = qs.split('&')
filtered_querystring = filter(lambda p: not p.split('=')[0].startswith('utm_'), querystring)
qs = '&'.join(filtered_querystring)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment