django-uploadify上传后的http错误500

时间:2012-03-07 16:53:32

标签: django http uploadify

使用的技术

上下文

我可以使用upload.html页面成功将文件上传到Web服务器(上传目录具有所需的权限)。但是,上载完成后,Web服务器将返回HTTP 500错误。

"POST /filemanager/view HTTP/1.1" 500 68788

如果我直接访问它(GET), / filemanager / view 页面会正确呈现。

代码

文件管理器/ urls.py

urlpatterns = patterns('filemanager.views',
    url(r'^upload/', direct_to_template, {'template': 'upload.html'}),
    url(r'^view/',
        ListView.as_view(
            queryset = Container.objects.all(),
            context_object_name='containers',
            template_name='view.html'),
        name='view'
        )
)

文件管理器/模板/ upload.html

{% load uploadify_tags %}
{% load url from future %}

<html>
    <head>
        <script type="text/javascript" src="{{ MEDIA_URL }}/js/uploadify/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="{{ MEDIA_URL }}/js/uploadify/swfobject.js"></script>
        <script type="text/javascript" src="{{ MEDIA_URL }}/js/uploadify/jquery.uploadify.js"></script>
    </head>

    <body>
        {% multi_file_upload '/filemanager/view' %}
    </body>
</html>

文件管理器/模板/ view.html

<html>
    <h1>File list</h1>
    <ul>
    {% if containers %}
        {% for container in containers %}
            <li>{{ container.file }}</li>
        {% endfor %}
    {% endif %}
    </ul>
</html>

在执行此类操作时,Django测试Web服务器是否可能出错?建议?

0 个答案:

没有答案
相关问题