@non_atomic_requests
def site(request, format, group, start=None, end=None):
 if ((not start) and (not end)):
  start = (date.today() - timedelta(days=365)).strftime('%Y%m%d')
  end = date.today().strftime('%Y%m%d')
 group = ('date' if (group == 'day') else group)
 (start, end) = get_daterange_or_404(start, end)
 (series, keys) = _site_query(group, start, end, request)
 if (format == 'csv'):
  return render_csv(request, None, series, (['date'] + keys), title='addons.mozilla.org week Site Statistics', show_disclaimer=True)
 return render_json(request, None, series)

@ non_atomic_requests def site ( request , format , group , start = None , end = None ) : if ( ( not start ) and ( not end ) ) : start = ( date . today ( ) - timedelta ( days = 365 ) ) . strftime ( '%Y%m%d' ) end = date . today ( ) . strftime ( '%Y%m%d' ) group = ( 'date' if ( group == 'day' ) else group ) ( start , end ) = get_daterange_or_404 ( start , end ) ( series , keys ) = _site_query ( group , start , end , request ) if ( format == 'csv' ) : return render_csv ( request , None , series , ( [ 'date' ] + keys ) , title = 'addons.mozilla.org week Site Statistics' , show_disclaimer = True ) return render_json ( request , None , series )
require an nginx site .