why my code error,about serve the static file using django..
- by zjm1126
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