# export to docx file problem

**URL:** <https://forum.djangoproject.com/t/export-to-docx-file-problem/16873>\
**Category:** Forms & APIs\
**Created:** [November 7, 2022, 1:56pm UTC](https://forum.djangoproject.com/t/export-to-docx-file-problem/16873 "2022-11-07T13:56:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![canizci](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/canizci/32/10734_2.png) [@canizci](https://forum.djangoproject.com/u/canizci)\
**Post date:** [November 7, 2022, 1:56pm UTC](https://forum.djangoproject.com/t/export-to-docx-file-problem/16873/1 "2022-11-07T13:56:19Z")

</div>

## ı export my table with docx . But when ı export to richtext field ı am not reading the value. how do i solve the problem

my function  
def docx\_icerik(request,kategori\_id):  
kategori\_id=int(kategori\_id)  
metinler=Durumanaliz.objects.filter(kategoriicerik\_name\_id=kategori\_id)

```
doc=DocxTemplate("icerikTmpl.docx")

context = {
'metinler':metinler,
}
doc.render(context)
response=HttpResponse(content_type='text/ms-word')
response['Content-Disposition']='attachment; filename=Metin.docx'   
doc.save(response)
return response

```

* * *

docx. file  
{% for icerik in icerikler%}  
{{metin.baslik}} ı am reading this value  
{{metin.icerik}} but this value richtext field this field not reading  
{% endfor %}

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 7, 2022, 2:05pm UTC](https://forum.djangoproject.com/t/export-to-docx-file-problem/16873/2 "2022-11-07T14:05:58Z")

</div>

When posting code here, copy/paste the code into the body of your post, surrounded by 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, which is critical with Python. (Note, you should also surround the traceback this way.)

Also, it appears that your issue may be related to a third-party library. Please identify all third-party libraries that may be involved with this issue - including the version number for each.

---

<div class="post-metadata">

**Author:** ![canizci](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/canizci/32/10734_2.png) [@canizci](https://forum.djangoproject.com/u/canizci)\
**Post date:** [November 7, 2022, 7:37pm UTC](https://forum.djangoproject.com/t/export-to-docx-file-problem/16873/3 "2022-11-07T19:37:40Z")

</div>

> [@KenWhitesell](#):
>
> When posting code here, copy/paste the code into the body of your post, surrounded by 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, which is critical with Python. (Note, you should also surround the traceback this way.)
> 
> Also, it appears that your issue may be related to a third-party library. Please identify all third-party libraries that may be involved with this issue - including the version number for each.

I’ll look into 3rd part software, thanks
