title: How to retrieve foreign key field in Django rest framework?
body: <p>Given the model and serializer classes below, when I retrieve Track details, it'll only show the Track title but not the related Artist. </p>
  
  <p>How would I also show the Artist name when retrieving Track details?</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Artist (models.Model):
      name = models.CharField(max_length=100)
  
      def __str__(self):
          return self.name
  
  class Track (models.Model):    
      artist = models.ForeignKey(Artist, blank=True, null=True, on_delete=models.SET_NULL, verbose_name="Artist")
      title = models.CharField(max_length=100, verbose_name="Title")
  
      def __str__(self):
          return self.title
  </code></pre>
  
  <p><strong>serializers.py</strong></p>
  
  <pre><code>class ArtistSerializer(serializers.ModelSerializer):
  
      id = serializers.IntegerField(read_only=True)
      name = serializers.CharField()
  
      class Meta:
          model = Artist
          fields = ('id', 'name')
  
  class TrackSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = Track
          fields = '__all__'
  </code></pre>