如何仅为视频上传配置 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.
到目前为止,我在 settings.py
和 urls.py
中添加了 uploadify
我添加了这个
So far, i added uploadify
in settings.py
and in urls.py
I added this
(r'^uploadify/',include('uploadify.urls')),
但还没有完成文档中描述的每一步,我当您告诉我如何仅为视频配置 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 不带有自定义文件字段 您仍将使用 AFAIK 没有此类验证的 django FileField(文件扩展名检查).
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.
您可以在此处
这篇关于如何仅为视频上传配置 django-uploadify?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!