settings:
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
urls:
from django.conf import settings
from django.conf.urls.static import static
末尾加
+ static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
在模板里:
<script type="text/javascript" src="/static/js/jquery.js"></script>