Avatar ·

Automatic filling of the form in Django Template

📁 Advanced Python Topics

Good afternoon.

There is a user profile form. When displaying on the screen, it should be filled with the current user's data. How can this be done?

   class   Profile  (models.Model): User = models.OneToOneField(User) img = models.ImageField(upload_to= 'user_pic/' , blank= True , verbose_name= 'avatar' ) Phone = models.IntegerField(max_length= 10 , verbose_name= 'Phone' )  class   ProfileForm  (forms.Form): first_name = forms.CharField(label= u'Name' , max_length=...