我正在使用django-storage将静态文件上传到amazon s3。第一次上传到s3工作正常,但django-storages没有检测到我已经更改了我的静态文件,所以它不会重新上载我更改的静态文件。
如何强制django-storage上传某些文件?
答案 0 :(得分:1)
Django storages 只是更改了后端,要同步静态中的更改,您仍然需要运行 DECLARE @mydate DATETIME ='2020-04-04'
SELECT
CASE
WHEN MONTH(@mydate) BETWEEN 2 AND 4 THEN CAST(YEAR(@mydate) - 1 as varchar)+'-11-01'
WHEN MONTH(@mydate) BETWEEN 5 AND 7 THEN CAST(YEAR(@mydate) as varchar)+'-02-01'
WHEN MONTH(@mydate) BETWEEN 8 AND 10 THEN CAST(YEAR(@mydate) as varchar)+'-05-01'
WHEN MONTH(@mydate) in(11,12) THEN CAST(YEAR(@mydate) as varchar)+'-08-01'
WHEN MONTH(@mydate)=1 THEN CAST(YEAR(@mydate) -1 as varchar)+'-08-01'
END AS Start_date,
CASE
WHEN MONTH(@mydate) BETWEEN 2 AND 4 THEN CAST(YEAR(@mydate) as varchar)+'-01-31'
WHEN MONTH(@mydate) BETWEEN 5 AND 7 THEN CAST(YEAR(@mydate) as varchar)+'-04-30'
WHEN MONTH(@mydate) BETWEEN 8 AND 10 THEN CAST(YEAR(@mydate) as varchar)+'-07-31'
WHEN MONTH(@mydate) in(11,12) THEN CAST(YEAR(@mydate) as varchar)+'-10-31'
WHEN MONTH(@mydate)=1 THEN CAST(YEAR(@mydate) -1 as varchar)+'-10-31'
END AS End_date
的 collectstatic 管理命令。请参阅enter link description here