pythondjangoapp-engine-patch

Serving simple image with App Engine django patch?


How the heck do i serve a simple img without all that MediaGenerator nonsense, in Django on App Engine? I am using app engine patch.

I got layout like this:

Where should my folder for my media be? In my_app? Or do I put everything in the top media folder?

I want to do something like this in my HTML template...

<img src="/site_media/my_image.jpg" />

Note that /media prefix is already beign used for admin media.


Solution

  • Well it seems that using app.yaml works out:

    - url: /my_app/media/
      static_dir: my_app/media
    

    Which allows me to refer to image a.jpg in folder my_app/media with a url like:

    <img src="/my_app/media/a.jpg" />