[Answered ]-Is the Basic File Upload example in the Django documentation correct?

1👍

As suggested by Willem VO supports mod strike, simply use {{ form }} in place of the…

<input type="file" name="file" required>

…line in upload.html.

NEW upload.html

<!DOCTYPE html>
<html>
<head>
    <title>File Upload</title>
</head>
<body>
    <h1>File Upload</h1>
    <form method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {{ form }}
        <button type="submit">Upload</button>
    </form>
</body>
</html>

Leave a comment