code: def source_lookup(request):
      
      source = request.GET['source']
      source_slug = slugify(source.strip())
      source_candidates = Dataset.objects.values('source').filter(
          source_slug__startswith=source_slug
      )
      sources = json.dumps([cand['source'] for cand in source_candidates])
  
      return HttpResponse(sources, content_type='application/json')
docs: JSON endpoint that returns a list of potential sources.
  
      Used for upload template autocomplete.