开发者

can you use this method to load staic file using django on google-app-engine

开发者 https://www.devze.com 2022-12-28 06:14 出处:网络
look this simple django on gae : http://code.google.com/p/google-app-engine-samples/source/browse/trunk/django_example

look this simple django on gae :

http://code.google.com/p/google-app-engine-samples/source/browse/trunk/django_example

and this is my code:

DIRNAME = os.path.dirname(__file__)
MEDIA_ROOT = os.path.join(DIRNAME, 'Media')
MEDIA_URL = '/mymedia/'


(r'^mymedia/(?P<path>.*)$', 'django.views.static.serve',{'document_root':settings.MEDIA_ROOT}),

<script type="text/javascript" src="/mymedia/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="/开发者_运维问答mymedia/js/reg.js"></script>

but i can't load the js file

can any one load this successful ??

thanks


AFAIR you need to define handling of static files in app.yaml on Google app engine. The django.views.static.serve works only in standalone web server in Django.

0

精彩评论

暂无评论...
验证码 换一张
取 消