# How to pre-fill a ModelForm with existing data

**URL:** <https://forum.djangoproject.com/t/how-to-pre-fill-a-modelform-with-existing-data/37926>\
**Category:** Forms & APIs\
**Created:** [January 13, 2025, 11:53am UTC](https://forum.djangoproject.com/t/how-to-pre-fill-a-modelform-with-existing-data/37926 "2025-01-13T11:53:42Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [January 13, 2025, 1:20pm UTC](https://forum.djangoproject.com/t/how-to-pre-fill-a-modelform-with-existing-data/37926/8 "2025-01-13T13:20:24Z")

</div>

What you have done here:

> [@H\_coder](#):
>
> ` profile_includes_form = ProfileIncludesForm()`

Is create a class-variable containing a blank instance of the form. This isn’t going to work the way you’re thinking it’s going to work.

A form is not a field.

💡 The light has gone on - now I think I understand what you’re trying to do.

Unfortunately, my response to this is “don’t do this”. Work with the two forms as two separate forms - do not try to integrate them like this. (This is an approach that I wouldn’t ever try to do.)

There’s a _lot_ of “metaprogramming magic” that occurs within the Django Form class, and even more with ModelForms.

I have a philosophy that has served me well for a long time: “Don’t fight the framework.” Do things the way the framework expects you to do them, don’t try to twist it to make it fit your mental model - change your mental model instead.

See the post at [How to handle forms that don't map easily to a single model](https://forum.djangoproject.com/t/how-to-handle-forms-that-dont-map-easily-to-a-single-model/14812) for some ideas.

There are other threads in the forum itself addressing this type of situation.

---

_[View the full topic](https://forum.djangoproject.com/t/how-to-pre-fill-a-modelform-with-existing-data/37926)._
