def main_report(request): main = Report.CESS( r'C:\Users\CTMayers\denpython\Reports\Files\Working Files\California+Lutheran+University+2018+CESS_November+25%2C+2018_18.29.csv', 'California Lutheran University') data = {} for section, frame in main.run_report(): data[section] = frame print(data['Q1_IMP']) for index, row in data['Q1_IMP'].iterrows(): for i, j in zip(row.index, row): print(i, j) # context = {data['Q1_IMP']} return render(request, 'reports/main.html')
def main2(request): import sys sys.path.append( r'C:\Users\CTMayers\Desktop\Research Toolkit\Creating Reports\Python') import Report main = Report.CESS( r'C:\Users\CTMayers\Desktop\Research Toolkit\Creating Reports\Python\Files\Working Files\California+Lutheran+University+2018+CESS_November+25%2C+2018_18.29.csv', 'California Lutheran University') data = {} for i, j in main.run_report(): data[i] = j.to_html() context = {'data': data} return render(request, "raw_data/index.html", context)