title: How to set ForeignKey in CreateView?
body: <p>I have a model:</p>
  
  <pre><code>class Article(models.Model):
      text = models.CharField()
      author = models.ForeignKey(User)
  </code></pre>
  
  <p>How do I write class-based view that creates a new model instance and sets <code>author</code> foreign key to <code>request.user</code>?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Solution moved to separate <a href="https://stackoverflow.com/a/10565744/1061572">answer</a> below.</p>