예제 #1
0
파일: views.py 프로젝트: pmains/states
def county_json(request, county, state):
  ''' Render json of individual county's data '''
  data = api.read_county(county, state)
  return HttpResponse(data, mimetype="application/json")
예제 #2
0
파일: views.py 프로젝트: pmains/states
def county(request, county, state):
  ''' Display data for an individual county '''
  data = { "county_data": json.loads(api.read_county(county, state)) }
  return render(request, "county.html", data)