Django Custom File Storage system

后端 未结 3 480
梦如初夏
梦如初夏 2021-02-08 17:59

I have a custom storage

import os
from django.core.files.storage import Storage


class AlwaysOverwriteFileSystemStorage(Storage):
    def get_available_name(sel         


        
3条回答
  •  醉酒成梦
    2021-02-08 18:18

    You can put it anywhere, but you should point the path to there in the settings.py

    You can put this storage.py file in the root folder (the one that has manage.py) and point the path as storage.AlwaysOverwriteFileSystemStorage

提交回复
热议问题