简体   繁体   English

使用Python将CSV文件上传到Google App Engine上的数据库

[英]upload CSV file to database on Google app engine using Python

I'm a newbie in python and started learning it from about a week. 我是python的新手,从大约一个星期开始学习它。 I was looking into couple of tasks one of which was to upload a file (.txt or .jpg) to a bucket on GAE. 我正在研究几个任务,其中之一是将文件(.txt或.jpg)上传到GAE上的存储桶。 I was able to solve it by following couple of tutorials online, but i'm stuck on second task. 我可以通过在线阅读一些教程来解决这个问题,但是我被困在第二项任务上。

So here's the task. 这就是任务。 i'm trying to upload a .CSV file from my local machine to the Database on Google app engine. 我正在尝试将.CSV文件从本地计算机上传到Google App Engine上的数据库。 I tried searching for solutions, but i could find only solutions pertaining to web applications. 我尝试搜索解决方案,但只能找到与Web应用程序有关的解决方案。 So is there a way to upload CSV file to the database instance that i have on GAE using python, is it even possible to do this? 因此,有没有一种方法可以将CSV文件上传到我使用python在GAE上拥有的数据库实例中,甚至可以做到这一点? or do we have to take up any alternatives. 还是我们必须采取其他选择。 Any working frameworks that could directly do this on git, someone used ? 任何可以直接在git上执行此操作的框架,有人使用过吗? Thanks in advance. 提前致谢。

You can upload your files into blobstore, using blobstore api 您可以使用blobstore api将文件上传到blobstore

Once you upload your file in blobstore, you get blobkey, then you can use blobreader, to read csv file content and store them according in your database. 在blobstore中上传文件后,您将获得blobkey,然后可以使用blobreader读取csv文件内容并将其存储在数据库中。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM