def send_extra(self):
"""
Sends any extra JS/CSS files placed in Gate One's 'static/extra'
directory. Can be useful if you want to use Gate One's file
synchronization and caching capabilities in your app.
.. note::
You may have to create the 'static/extra' directory before putting
files in there.
"""
#extra_path = resource_filename('gateone', 'static/extra')
extra_path = os.path.join(getsettings('BASE_DIR'), 'static/extra')
#if not resource_exists('gateone', '/static/extra'):
#return # Nothing to do
if not os.path.exists(extra_path):
return # Nothing to do
#for f in resource_listdir('gateone', '/static/extra'):
#filepath = resource_filename('gateone', '/static/extra/%s' % f)
#if filepath.endswith('.js'):
#self.send_js(filepath, force=True)
#elif filepath.endswith('.css'):
#self.send_css(filepath, force=True)
for f in os.listdir(extra_path):
filepath = os.path.join(extra_path,f)
if filepath.endswith('.js'):
self.send_js(filepath, force=True)
elif filepath.endswith('.css'):
self.send_css(filepath, force=True)
评论列表
文章目录