1. app.yaml (set static_dir fold)

- url: /media
  static_dir: media

This is probably the easiest way to do this.

2. use zipserve

- url: /tinymce/.*
  script: $PYTHON_LIB/google/appengine/ext/zipserve

put the above code in your app.yaml file.
Note: This is a solution for apps that want to serve 1000s of small static
files while staying withing the 1000 file limit.

3. use Django's static file serve


import os
urlpatterns = auth_patterns + patterns('',
    (r'^themes/(?P<path>.*), django.views.static.serve', 
 {'document_root':os.path.dirname(os.path.abspath(__file__)) + '/themes/'}),
) + urlpatterns

put the about code in your Django file urls.py. 

For more details on how to serve static files with Django, refer to https://docs.djangoproject.com/en/1.2/howto/static-files/

If you don't know how to use Django on GAE, don't worry, I will walk you through shortly

Relate Posts:

Tags: GAE Django static files

Posted in Google App English |

Leave a Reply