#NEWLINE# @ register . simple_tag #NEWLINE# def static( filename , flags = '' ) : #NEWLINE# #INDENT# '\n        see http://insist.sk/blog/django/149.html\n    ' #NEWLINE# flags = set ( ( f . strip ( ) for f in flags . split ( ',' ) ) ) #NEWLINE# url = urlparse . urljoin ( dndproject . settings . STATIC_URL , filename ) #NEWLINE# if ( 'absolute' in f ) : #NEWLINE# #INDENT# url = _absolute_url ( url ) #NEWLINE# #UNINDENT# if ( ( ( filename . endswith ( '.css' ) or filename . endswith ( '.js' ) ) and ( 'no-timestamp' not in flags ) ) or ( 'timestamp' in flags ) ) : #NEWLINE# #INDENT# fullname = os . path . join ( dndproject . settings . STATICFILES_DIRS [ 0 ] , filename ) #NEWLINE# if os . path . exists ( fullname ) : #NEWLINE# #INDENT# url += ( '?%d' % os . path . getmtime ( fullname ) ) #NEWLINE# #UNINDENT# #UNINDENT# return url