1. 程式人生 > >靜態資源配置

靜態資源配置

-1 源配置 dir 註意 資源 cfile 不同的 pat 1.8


STATIC_URL = ‘/static/‘ #別名
STATIC_ROOT=os.path.join(BASE_DIR,‘app01/static‘) #絕對路徑



STATIC_URL = ‘/static/‘

STATICFILES_DIRS = (
( os.path.join(BASE_DIR, "statics")),
)


註意2(statics文件夾寫在不同的app下,靜態文件的調用):

STATIC_URL = ‘/static/‘

STATICFILES_DIRS = (
(‘demo_statics‘,os.path.join(BASE_DIR, "statics")),
)
<script src="/static/demo_statics/jquery-1.8.2.min.js"></script>

靜態資源配置