Updating the code for pythonic way.
Uploading database