Django使用本地css/js方法:
STATIC_URL = '/static/'
HERE = os.path.dirname(os.path.abspath(__file__))
HERE = os.path.join(HERE, '../')
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(HERE, 'static/'),
)
在需要使用的html文件中通过以下方式导入
<link rel="stylesheet" href="../static/style/medicine.css" />
<script type="text/javascript" src="../static/javascript/medicine.js"></script>