如何通过django admin上传
documents = models.FileField(upload_to=settings.FILE_PATH, verbose_name=
_('Attach Your Documents'), help_text=_('.pdf file not exceeding 5 mb.'),
null=True, blank=True)
通过这种方式,我正在为django admin
中的文件的上传
创建模型。现在,当有人在 django admin
上单击save
时,我想将此文件上传到 S3
。我应该在哪里编写上传
到s3的方法。我不明白。
documents = models.FileField(upload_to=settings.FILE_PATH, verbose_name=
_('Attach Your Documents'), help_text=_('.pdf file not exceeding 5 mb.'),
null=True, blank=True)
By this way i am creating a models for the upload
of a file in django admin
. Now I want to upload this file to S3
when some one click save
on django admin
. Where should i write the methods for uploading
to s3. I am not getting any idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以尝试 django-storages
You could try django-storages