Python 3 Django Currency Converter of Different Countries GUI in Browser Full Project For Beginners

 

 

django-currency-converter

currency-converter of different countries Django v2.2+, python3.5+

procedure to install django-currency-converter project

  1. Clone the project.
  2. Create python virtual environment.
  3. install requirements. $ pip install -r requirements.txt
  4. apply migrate. $ python manage.py migrate
  5. at last run django server and open localhost. $ python manage.py runserver and open http://localhost:8000

Here are demo picture

 

 

 

certifi==2019.6.16
chardet==3.0.4
Django==2.2.5
django-crispy-forms==1.7.2
idna==2.8
pkg-resources==0.0.0
pytz==2019.2
requests==2.22.0
sqlparse==0.3.0
urllib3==1.25.3

 

 

 

from django import forms

# dummy choices 
choices=INTEGER_CHOICES = [('', '')]

class CurrencyForm(forms.Form):
    source_currency_value = forms.DecimalField(label='Amount')
    source_currency_code = forms.CharField(label='From', widget = forms.Select(choices=INTEGER_CHOICES))
    target_currency_code = forms.CharField(label='To', widget = forms.Select(choices=INTEGER_CHOICES))


    def __init__(self, tuple_country_code, *args, **kwargs):
        # required to set the initial form drop down with choices
        self.tuple_country_code = tuple_country_code
        super(CurrencyForm,self).__init__(*args, **kwargs)

        self.fields['source_currency_code'].widget.choices = self.tuple_country_code
        self.fields['target_currency_code'].widget.choices = self.tuple_country_code

 

 

 

DOWNLOAD FULL SOURCE CODE

 

Leave a Reply