django 的 staticfile

今天一直在搞這個, 搞不定。以下是整理的結果。

若 DEBUG = False, django 會跑去 STATIC_ROOT 設定的 folder 底下找 css/js 等檔案。如果這邊找不到, 會直接在 manage.py 噴 error 並且出現下列訊息

ValueError: The file 'mod.font.css' could not be found with <pipeline.storage.PipelineCachedStorage object at 0x7faca89dbf90>

另外, 也是在 DEBUG = False 的情況之下, urlpatterns += staticfiles_urlpatterns() 也是沒有用的。詳情請見 https://github.com/django/django/blob/master/django/conf/urls/static.py