简体   繁体   English

Google App Engine、Django、CloudSQL 和图像

[英]Google App Engine, Django, CloudSQL and Images

Currently porting some Django projects over to Google App Engine.目前正在将一些 Django 项目移植到 Google App Engine。 I am using Python 2.7, Django 1.4 and Google CloudSQL.我使用的是 Python 2.7、Django 1.4 和 Google CloudSQL。

The problem I have is with an Admin driven Gallery.我遇到的问题是管理员驱动的画廊。 Handling image upload seems to be a problem, using ImageField I am getting an erorr on mkdir command as GAE wont allow a local write.处理图像上传似乎是一个问题,使用 ImageField 我在 mkdir 命令上遇到错误,因为 GAE 不允许本地写入。

I am a little stuck and solutions seem quite confused, I am using CloudSQL due to its compatibility with the old MySQL databases that ran the sites previously.我有点卡住了,解决方案似乎很困惑,我正在使用 CloudSQL,因为它与以前运行站点的旧 MySQL 数据库兼容。

How can I get the gallery back up and running without local storage?如何在没有本地存储的情况下备份和运行图库? I have been researching use of GAE blobstore, but posts seem quite varied and unhelpful.我一直在研究 GAE blobstore 的使用,但帖子似乎多种多样且毫无帮助。

Cheers Kevin干杯凯文

You'll have to rewrite ImageField to use the BlobStore instead of files.您必须重写 ImageField 以使用 BlobStore 而不是文件。

A quick google search suggests someone might have already done this: http://blog.uysrc.com/2011/02/12/image-uploads-working-with-models-imagefield/快速谷歌搜索表明有人可能已经这样做了: http : //blog.uysrc.com/2011/02/12/image-uploads-working-with-models-imagefield/

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

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