Skip to content

saratpediredla/appengine-image-host

 
 

Repository files navigation

Google AppEngine Image Hosting

Simple image management application for use on Google AppEngine with the option to use Amazon S3 as a storage back-end.

Background

In Gareth’s words
“I like to add the odd image to a blog post now and then, but hate having to upload and resize images so they fit nicely. This simple application scratches that itch. Simply upload and resize images and then host them from AppEngine. It was also the perfect opportunity to play with the Image API.”

I modified the code to make it clever (although the code itself is not clever), to be able to switch to Amazon S3 if the S3 settings are specified. It fails gracefully to store images on Google App Engine if there are no S3 settings, but needs better handling.

Usage

For the most part it’s just a matter of deploying to AppEngine which I won’t cover here. Read the official documentation for details.

By default images are viewable by everyone but the upload panel is only available to the administration for your account. If you want to make that available to any registered user then change the following line in the app.yaml configuration file.

- url: /.*
  script: backend.py
  login: admin

To this:

- url: /.*
  script: backend.py
  login: required

How to enable Amazon S3 storage

To enable S3 storage, all you need to do is either modify the awskeys.py file or add your own awskeys_local.py file (this is there to prevent your keys getting committed to GitHub, which they will if you are using a Git copy and use awskeys.py to store your keys).

Limitations

It currently uses keys to identify resources, which has the advantage of being very easy to implement and the disadvantage of making sharing data between instances impossible. This means if you upload images locally to test things out you’ll have to upload them again when you deploy to App Engine. I might fix that if I get bored or it I start to make extensive use of it.

Licence

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

Simple image resizing and hosting application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%