COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
那麼你有可能會遇到以下錯誤訊息
- You have offline compression enabled but key "70be2d0f8286eb3a32bfe94a55518c8f" is missing from offline manifest. You may need to run "python manage.py compress".
因為 compressor 是用內容 hash 成 hash code 去 lookup cached javascript
所以 offline compress 的東西產生的 hash code 會跟你線上得到的 code 不一樣
例如以下這個例子,拿掉{{user.email}}即可正常
- {% compress js %}
- ......
- formData.append('email', '{{ user.email }}');
- ......
- {% endcompress %}