# How to use orm while using DRF?

**URL:** <https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378>\
**Category:** Forms & APIs\
**Created:** [August 11, 2022, 10:29pm UTC](https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378 "2022-08-11T22:29:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spongyMongy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/spongymongy/32/9671_2.png) [@spongyMongy](https://forum.djangoproject.com/u/spongyMongy)\
**Post date:** [August 11, 2022, 10:29pm UTC](https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378/1 "2022-08-11T22:29:58Z")

</div>

Hi dear folks, (cheers to all ) this is my first message so pls forgive me for the possible mistakes.  
I am creating an application which will use DRF to send and get data connected to a database…  
Kindly my questions are:

1. Should I use orm while doing POST requests, I mean after getting the data from the user should I modelize the data first and do the query with orm way or should I just go with the raw sql query ?
2. I believe the same answer applies for GET method also, right?
3. What about if it was an already existing external database (which was not modelled already). In that case shouldn’t we be sure that all data we are interacting is being modeled by our application? If so - how? 🙂

Thank you very much in advance/ (cheers again)

---

<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:** [August 12, 2022, 2:46am UTC](https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378/2 "2022-08-12T02:46:13Z")

</div>

What is your current experience level with Django and DRF?

Have you built other projects using these tools, or is this your first?

---

<div class="post-metadata">

**Author:** ![Suraj7879](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/suraj7879/32/9623_2.png) [@Suraj7879](https://forum.djangoproject.com/u/Suraj7879)\
**Post date:** [August 12, 2022, 3:51am UTC](https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378/3 "2022-08-12T03:51:22Z")

</div>

Have a look at seriailzers which DRF Provides by default. You have to create the schema, or model the data field in models.py, then you have to create the serializers and views, and their job will be to communicate with you database.

---

<div class="post-metadata">

**Author:** ![spongyMongy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/spongymongy/32/9671_2.png) [@spongyMongy](https://forum.djangoproject.com/u/spongyMongy)\
**Post date:** [August 12, 2022, 2:36pm UTC](https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378/4 "2022-08-12T14:36:55Z")

</div>

Hi, I used those to create some projects but mostly not in very high level. Thanks

---

<div class="post-metadata">

**Author:** ![spongyMongy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/spongymongy/32/9671_2.png) [@spongyMongy](https://forum.djangoproject.com/u/spongyMongy)\
**Post date:** [August 12, 2022, 2:39pm UTC](https://forum.djangoproject.com/t/how-to-use-orm-while-using-drf/15378/5 "2022-08-12T14:39:10Z")

</div>

Hi, thank you Suraj I think I know the mechanism , just not sure when/if to serialize all data in the database (especially when db is under my control and when it is totally external)
