Reputation: 105
I recently was learning the diango upload mechanism ,but i got a one thing confusing ,It's about the storage of the uploaded file infomation, i know if i creat model with FileField in it,and i use the modelform ,config the DEFAULT_FILE_STORAGE as default which is django.core.files.storage.FileSystemStorage .i set the FileField's Upload_to='Video'.
my confusion is : where would the file infomation(like name,path,url,etc that FileSystemStorages would provide,not the file itself) save to, It seem that django create a foreignKey Table(Model) that store these file infomation ?
Thank you for your help.
Upvotes: 0
Views: 323
Reputation: 798606
FileField
only cares about the local filename and storage mechanism; other fields in the table must be used to give the file a meaningful external name.
Upvotes: 1