Загрузка фпйла

This commit is contained in:
iriska-gri committed 2023-10-20 11:49:38 +03:00
1 parent 71065dbef4
commit ca5c9830d6
5 files changed
+10782 -330

No files matched your search

+5 -20
View File
@@ -221,23 +221,8 @@ class DailyRoundUpAPIView(APIView):
# df.to_excel(table)
# def all_books(request):
# file_path = 'media/DailyRoundUp.xlsx'
# workbook = load_workbook(filename=file_path)
# worksheet = workbook.active
# books = []
# skip_first_row = True
# for row in worksheet.iter_rows(values_only=True, min_row=2 if skip_first_row else 1):
# book = {
# 'book_id': int(row[0]),
# 'title': row[1],
# 'author': row[2],
# 'genre': row[3],
# 'year': int(row[4]),
# 'description': row[5],
# 'cover': row[6]
# }
# books.append(book)
# return render(request, 'books.html', {'books': books})
def post(self, request):
file = request.data['dailyfiles']
df = pd.read_excel(file)
print(df)
return Response('')