Dar Hamid
Dar Hamid

Reputation: 1979

Getting name 'COUNTRIES' is not defined error in django

i am new to Django. I want to add country field to my form. i have installed module django_countries from here : https://bitbucket.org/smileychris/django-countries

Now when i use:

from OpenErp_Django.django_countries import CountryField
class UserForm(forms.Form):
        country = forms.ChoiceField(choices=(('', _('select country')),) + COUNTRIES)

I am getting following error: name 'COUNTRIES' is not defined I dont know what to do. I am stuck. Can Someone help

Upvotes: 0

Views: 281

Answers (1)

DrTyrsa
DrTyrsa

Reputation: 31951

You forgot to import it

from OpenErp_Django.django_countries.countries import COUNTRIES

Upvotes: 5

Related Questions