[Django]-How to use django countries in registration form?

5👍

You should set choices like this:

from django_countries import countries
COUNTRY_CHOICES = tuple(countries)

class SignupForm(forms.Form):
    country = forms.ChoiceField(choices=COUNTRY_CHOICES, required=True)

Leave a comment