Fill This Form To Receive Instant Help
Homework answers / question archive / The goal of the fourth project is to add 1 extra feature to the Web application developed in Project #3
The goal of the fourth project is to add 1 extra feature to the Web application developed in Project #3. In order to achieve that, we will use Python, Flask, PyMongo, HTML, CSS, JS, and 1 new API.
Preliminaries
Copy from Project 3 all the files, except venv (since you configured a new virtual environment in Project #4).
The project will have the follow hierarchy:
> <strong>Project4 </strong>>> app.py >> <strong>static </strong>>>><strong> css </strong>>>> <strong>images </strong>>>> <strong>js </strong><strong></strong>>> <strong>templates </strong>>>> addExpenses.html >>> expensesAdded.html >>> index.html >>> template.html
(In bold: directories)
In this modified WebApp, the user needs to log some expenses based on the following fields:
Nonetheless, notice that we have a new field, a dropdown menu, for the user to choose the currency. Please sign up for the currencylayer API. This is a reliable exchange rates and currency API used for conversion for your business applications. It provides real-time JSON API for 168 world currencies.
A snippet of the function you should add with the http endpoint is:
def currency_converter(cost,currency): url="http://api.currencylayer.com/live?access_key=YOUR_KEY_GOES_HERE" response = requests.get(url).json() ### YOUR TASK IS TO COMPLETE THIS FUNCTION return converted_cost
Don't forget to paste your unique API key to the url string.
Your job is to finish this new function above in the app.py script file to convert from the selected currency to US Dollar. For example, the user can choose among some currencies, such as Colombian Peso, so the application will need to convert that entry/value to US Dollar before inserting that document to the databases. In other words, your application only displays values in US Dollars, but it is able to accept values in other currencies entered by the user.
The main page should remain the same as the one in Project #3. The following video shows an example of the features and mechanisms of this WebApp:
Please submit a .zip file to this assignment page.
1 - Create file requirements.txt that contains all packages needed for running the project 2 - install packages using requirement.txt with command line pip install -r requirements.txt 3 - paste all project3 files except venv 4 - create app.py import librairies 5 - create index function that redirect to index.html 6 - index.html contains design and event click 7 - Link post method with app.py function currency_converter and call api to get value of chnages 8 - render html file and send with the value of change
please download the answer file using this link
https://drive.google.com/file/d/1wsFfUhg_6Hind905cNzCkLDupEJ9pvlz/view?usp=sharing