【问题标题】:How to upload an image in django web application? [closed]如何在 Django Web 应用程序中上传图像? [关闭]
【发布时间】:2013-10-12 12:18:43
【问题描述】:

我需要要求用户在 django 网络应用程序上上传图像,但我不知道如何开始以及在 views.py 或 models.py 或 settings.py 中写什么 我搜索了答案,但没有得到完整或逐步的答案(我是 django 新手) 我在 settings.py 中给出了 MEDIA_ROOT 和 MEDIA_URL 但需要进一步实施的帮助

【问题讨论】:

标签: python html django image-upload


【解决方案1】:

下载https://github.com/doph/minimal-django-file-upload-example,这里建议:Need a minimal Django file upload example

这是一个基本的 Django 项目,带有单个应用程序,使用 media/ 目录进行上传。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-18
    • 1970-01-01
    • 1970-01-01
    • 2018-10-26
    • 2016-01-22
    • 2012-05-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多