コード例 #1
0
ファイル: main.py プロジェクト: shupp/kestrelweb
def static(request, filepath):
    body = ''
    content_type = 'test/plain'

    try:
        body = util.static(filepath)
        if filepath.endswith('.css'):
            content_type = 'text/css'
        elif filepath.endswith('.js'):
            content_type = 'text/javascript'
        elif filepath.endswith('.html'):
            content_type = 'text/html'
    except:
        pass

    return dream.Response(body=body, content_type=content_type)
コード例 #2
0
ファイル: widgets.py プロジェクト: Ddper/django-xadmin
 def media(self):
     return forms.Media(js=[static('xadmin/js/bootstrap-timepicker.js'), static("xadmin/js/widgets/datetime.js")],
         css={'screen': [static('xadmin/css/timepicker.css')]})
コード例 #3
0
ファイル: widgets.py プロジェクト: ntsai/django-xadmin
 def media(self):
     return forms.Media(
         js=[static("xadmin/js/bootstrap-datepicker.js"), static("xadmin//js/widgets/datetime.js")],
         css={"screen": [static("xadmin/css/datepicker.css")]},
     )