一、Django 静态文件配置
/mysite1/settings.py
STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR,'static') ]
/templates/timer.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>timer</title> <link rel="stylesheet" href="/static/timer.css"> </head> <body> <h4>当前时间:{{ date }}</h4> </body> <script src="/static/jquery-3.2.1.min.js"></script> <script src="/static/timer.js"></script> </html>
/static/...
效果