如何配置django-uploadify仅供上传视频? [英] How to configure django-uploadify for videos upload only?
问题描述
我想使用 django-uploadify 仅上传视频,我只想要上传视频,各种视频,或至少所有流行的视频格式。
I want to use django-uploadify to upload for videos only, I just want it to upload videos only, all kind of videos, or at least all kind of popular video formats.
到目前为止,我添加了 uploadify
和 urls.py
我添加了这个
So far, i added uploadify
in settings.py
and in urls.py
I added this
(r'^ uploadify /',include('uploadify.urls')),
但是,没有经历过 docs 中描述的每一步,当您告诉我如何仅配置django-uploadify视频时,请执行其他步骤。
But didn't go through every step described in the docs just yet, I'll do the other steps when you tell me how to configure django-uploadify for videos only.
django-uploadify没有很好的记录,所以我依靠你的经验
django-uploadify is not well documented so i'm relying on your experience to configure it.
如果您有更好的方式创建视频上传表单,请告诉我。
if you have a better way to create a video uploading form, please tell me.
推荐答案
django-uploadify没有一个cus tom文件夹你仍然要使用django FileField,AFAIK没有这种验证(文件扩展名检查)。
django-uploadify does not come with a custom filefield you are still going to use the django FileField that AFAIK does not have this kind of validation (filename extension checking).
你必须实现自己这个验证,你可以使用模型验证,或者您可以扩展django-uploadify表单并在其中添加一些验证。
You have to implement yourself this validation, you can do that using model validation or you can extend the django-uploadify form and add some validation there.
您可以看到代码示例 here
这篇关于如何配置django-uploadify仅供上传视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!