why my code error,about serve the static file using django..

Posted by zjm1126 on Stack Overflow See other posts from Stack Overflow or by zjm1126
Published on 2010-03-23T01:27:39Z Indexed on 2010/03/23 1:31 UTC
Read the original article Hit count: 390

Filed under:
|

my settings.py:

DIRNAME = os.path.dirname(__file__)
STATIC_DOC_ROOT = os.path.join(DIRNAME, 'media')
MEDIA_URL = '/media/'

my urls.py:

def google(request):
    return render_to_response('a.html',context_instance=RequestContext(request))
urlpatterns = patterns('',
    (r'^$',google),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root':settings.STATIC_DOC_ROOT,'show_indexes': True}),

)

and my a.html is:

<script type="text/javascript" src="/media/jquery-1.4.2.js"></script>
    <script type="text/javascript">
        alert($)
    </script>

but,it can't defiend the '$'

why ?

thanks

© Stack Overflow or respective owner

Related posts about python

Related posts about django