pppconverter
pppconverter copied to clipboard
Argentina country is missing and environment setup doesn't work
Missing Argentina is probably related to requiring newer data import. I followed the instructions to set up a local environment and update the CSV data in order to check Argentina. The process seems to have been successful from the commands' output, but it doesn't work. Whenever I go to http://127.0.0.1:5000/
I get an error logged to the terminal:
env ❯ ./manage.py runserver
* Serving Flask app "website" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
/Users/alejandro/Development/pppconverter/website.py:49: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0.
form = SalaryForm()
/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/sqlalchemy/sql/sqltypes.py:639: SAWarning: Dialect sqlite+pysqlite does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.
"storage." % (dialect.name, dialect.driver)
[2019-01-28 18:36:54,358] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/alejandro/Development/pppconverter/website.py", line 69, in index
'conversion_rate': float(conversion.value) * 100,
AttributeError: 'NoneType' object has no attribute 'value'
127.0.0.1 - - [28/Jan/2019 18:36:54] "GET / HTTP/1.1" 500 -
Okay, so I know solutions to both of them.
- I only use the latest data. So if argentina doesn't have latest data, it doesn't import it. Eg: If the latest year is 2017 and most countries have 2017 data, but Argentia doesn't, then I don't import the old data for Argentina because that is not an accurate comparison (if that makes sense).
- The error is most likely because you don't have a conversion rate for pound to dollar. I use an API for that. You could also just update that table manually with an entry. In the config table add an entry with a key
gbp_rate
and any value. It's just used for display on the home page.
@nigelbabu I can see Argentina does have the latest data for 2017 which is the latest I can see for all countries from the World Bank CSV file.
Regarding the pound to dollar conversion rate, I'm not so savvy on this stack (Python, etc.) to be able to adjust it quickly.
@nigelbabu any updates? Could you update the data in the deployed site so that we in Argentina can benefit from the calculator? We are in crazy times and the economy here is going worse as well. I think we need a way to provide reasonable prices for our services and this might be of much help.
My latest update this month has Argentina and I can confirm it works.