0
可用的文件名我有這樣的錯誤保存在創建這個模型的實例化身後(我沒有重寫任何基礎的Django模型方法):SuspiciousFileOperation:存儲找不到
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def conference_directory_path(instance, filename):
return BASE_DIR+'/static/dialogues/conferences/conference_{0}/avatar/{1}'.format(instance.id, filename)
class Dialogue(models.Model):
...
avatar = models.ImageField(upload_to=conference_directory_path, blank=True)
...
怎麼了?
非常感謝! –