I’m trying to make a form for updating user accounts in Django that is autopopulated with the current account data for that particular user. I can do this with HTML, but would rather find a way to make it work using Django’s form system. I can’t use Django’s built-in user management due to certain constraints and am having to construct my own. I’m lost on where to start with this.
Share
If you’re using a normal form (sublassing
forms.Form), pass data in using theinitialkeyword argument to your form constructor:An even easier way, though, is using Django’s ModelForms. Something like: