error when add array to docs

def generate_word_report(request):
    if request.method == 'POST':
        doc = Document()
        data = json.loads(request.body)
        form_data = data.get('formData', {})
        table_list = data.get('tableData', [])

      

        title = doc.add_heading('Sample Word Report', level=1)
        title.alignment = WD_ALIGN_PARAGRAPH.CENTER
        doc.add_paragraph("This is a sample Word report generated using Django and python-docx.")
        doc.add_paragraph("You can add more paragraphs and formatting as needed.")
        response = HttpResponse(content_type='application/vnd.openxmlformats-officedocument.wordprocessingml.document')
        response['Content-Disposition'] = 'attachment; filename="sample_report.docx"'
        doc.save(response)

        return response

what is the problem when generates report always says content missing but if im going to remove the form_data = data.get('formData', {})
table_list = data.get('tableData', []) the print works.

Side note: When posting code here, enclose your code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of editing your post here for that, please remember to do this in the future.)

If you’re getting an error, please post the complete error message and traceback. (You should always do this when asking for assistance with an error here.)