title: Django widgets don't work : Country flags
body: <p>I'm adding a new library : <code>Django_countries</code> on my Django Project and I get a little problem with my form.</p>
  
  <p>I get correctly my countries list inside my form, but I don't display flags with widgets beside each country.</p>
  
  <p>I'm using this documentation : <a href="https://pypi.python.org/pypi/django-countries" rel="nofollow noreferrer">https://pypi.python.org/pypi/django-countries</a> But I don't find a way to display country flags even if all elements seem to work.</p>
  
  <p>This is my <strong>models.py</strong> file from BirthCertificate application :</p>
  
  <pre><code>#-*- coding: utf-8 -*-
  
  from django.db import models
  from Identity.models import Country, Identity
  from django.utils.encoding import force_text
  from django_countries.fields import CountryField
  
  ######################################
  # Choix à l'utilisateur pour le sexe #
  ######################################
  
  SEX_CHOICES = (
      ('Masculin', 'Masculin'),
      ('Feminin', 'Feminin')
  )
  
  ####################################################################################
  # Création d'une table permettant de renseigner toutes les informations concernant #
  #               l'enfant et reprise des champs pour les parents                    #
  ####################################################################################
  
  class BirthCertificate(models.Model):
  
      lastname = models.CharField(max_length=30, null=False, verbose_name='Nom de famille')
      firstname = models.CharField(max_length=30, null=False, verbose_name='Prénom(s)')
      sex = models.CharField(max_length=8, choices=SEX_CHOICES, verbose_name='Sexe')
      birthday = models.DateField(null=False, verbose_name='Date de naissance')
      birthhour = models.TimeField(null=True, verbose_name='Heure de naissance')
      birthcity = models.CharField(max_length=30, null=False, verbose_name='Ville de naissance')
      birthcountry = CountryField(blank_label='(Pays de naissance)')
      fk_parent1 = models.ForeignKey(Identity, related_name='ID_Parent1', verbose_name='ID parent1', null=False)
      fk_parent2 = models.ForeignKey(Identity, related_name='ID_Parent2', verbose_name='ID parent2', null=False)
  </code></pre>
  
  <p>This is my <strong>forms.py</strong> file :</p>
  
  <pre><code>#-*- coding: utf-8 -*-
  
  from django import forms
  from BirthCertificate.models import *
  from django_countries.widgets import CountrySelectWidget
  
  class CustomLabelModelChoiceField(forms.ModelChoiceField):
  
      def __init__(self, *args, **kwargs):
          self._label_from_instance = kwargs.pop('label_func', force_text)
          super(CustomLabelModelChoiceField, self).__init__(*args, **kwargs)
  
      def label_from_instance(self, obj):
          return self._label_from_instance(obj)
  
  class BirthCertificateForm(forms.ModelForm):
      fk_parent1 = CustomLabelModelChoiceField(Identity.objects.filter(sex = "Masculin"), required=False, label = "Père", label_func=lambda obj: '%s %s %s %s' % (obj.lastname, obj.firstname, obj.birthday, obj.birthcity))
      fk_parent2 = CustomLabelModelChoiceField(Identity.objects.filter(sex = "Feminin"), required=False, label = "Mère", label_func=lambda obj: '%s %s %s %s' % (obj.lastname, obj.firstname, obj.birthday, obj.birthcity))
  
      class Meta :
          model = BirthCertificate
          fields = '__all__'
          widgets = {'country': CountrySelectWidget()}
  
      def __init__(self, *args, **kwargs):    
          super(BirthCertificateForm, self).__init__(*args, **kwargs)
          for key, value in self.fields.iteritems() :
              self.fields[key].widget.attrs.update({'class':'form-fields'})            
  
  class IdentityForm(forms.ModelForm) :
  
      class Meta :
          model = Identity
          fields = '__all__'
          widgets = {'country': CountrySelectWidget()}
  </code></pre>
  
  <p>My form looks like :</p>
  
  <p><a href="https://i.stack.imgur.com/i8FYh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i8FYh.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>My HTML template corresponding to BirthCertificate Form :</p>
  
  <pre><code>{% extends 'Base_BirthCertificate.html' %}
  
  {% load staticfiles %}
  
  {% block content %}
  
      &lt;!-- ############### --&gt;
      &lt;!-- Page principale --&gt;
      &lt;!-- ############### --&gt;
  
      &lt;h1 align="center"&gt; Formulaire d'acte de naissance &lt;/h1&gt;
  
      {% load bootstrap %}
  
      &lt;form class = "col-sm-8" method='POST' action=''&gt; {% csrf_token %}
          &lt;h3&gt; Formulaire permettant la création de l'acte de naissance&lt;/h3&gt;
          &lt;br&gt;&lt;/br&gt;
          {{ Bform|bootstrap}} &lt;!-- Display child part formulary --&gt;
          {{ value|date:"%d/%m/%Y" }}
          {{ value|time:"H:M" }}
          &lt;br&gt;&lt;/br&gt;
  
      &lt;input class="button" type ="submit" name="_save2" value="Valider l'acte de naissance" /&gt; 
      &lt;input class="button" type ="submit" name="_preview2" value="Prévisualiser l'acte de naissance" /&gt;
      &lt;/form&gt;
      &lt;form class = "col-sm-8" method='POST' action="{% url "BChome" %}"&gt; {% csrf_token %}
      &lt;input class="button" type ="submit" name="retour" value="Retour" /&gt; 
      &lt;/form&gt;   
  
  {% endblock content %}
  </code></pre>
  
  <p>And the browser's console doesn't display errors :</p>
  
  <p><a href="https://i.stack.imgur.com/MdCNn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MdCNn.png" alt="enter image description here"></a></p>