title: How do I add username of logged in user to model field in django
body: <p>How to add username of currently logged in user to field in my model? For example, I need to store info about user like name, email and so on in model, other than default Django user model, but I still use default one to store credentials. I want to establish relationship between those, so I created <code>username</code> field in my model. How do I fill it with current user's username upon saving the corresponding form?
  My model</p>
  
  <pre><code>class ApplicantProfile(models.Model):
      name = models.CharField(max_length = 50)
      dob = models.DateField()
      email = models.EmailField()
      description = models.TextField()
      username = &lt;something&gt;
  </code></pre>
  
  <p>What do I change <code>&lt;something&gt;</code> with?</p>
  
  <p>My form</p>
  
  <pre><code>class ApplicantProfileEdit(forms.ModelForm):
  class Meta:
      model = ApplicantProfile
      fields = [
          'name',
          'dob',
          'email',
          'description',
      ]
  </code></pre>
  
  <p>My view</p>
  
  <pre><code>def ApplEditView(request):
      form = ApplicantProfileEdit(request.POST or None)
      if form.is_valid():
         form.save()
         form = ApplicantProfileEdit()
      context = {
         'form':form
      }
      return render(request, "applProfileEdit.html", context)
  </code></pre>
  
  <p>P.S. I tried to import models straight to my <code>views.py</code>, and assign <code>request.user.username</code> to <code>username</code> field of the model in my view, but it didn't work, just left that field empty. I had <code>username</code> as <code>CharField</code> when I tried this.</p>