fix django example to work with 1.3 .

This commit is contained in:
benoitc 2011-05-18 18:22:55 +02:00
parent 179b87639c
commit 76aef105d5
3 changed files with 10 additions and 3 deletions

View File

@ -62,6 +62,11 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware',
)
FILE_UPLOAD_HANDLERS = (
"django.core.files.uploadhandler.TemporaryFileUploadHandler",
)
ROOT_URLCONF = 'djangotest.urls'
TEMPLATE_DIRS = ()

View File

@ -1,7 +1,8 @@
{% extends "base.html" %}
{% block content %}
<form method="post" enctype='multipart/form-data'>
<form method="post" enctype='multipart/form-data'>
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
@ -14,4 +15,4 @@
<p><strong>message:</strong><br>{{ message }}</p>
<p><strong>size:</strong><br>{{ size }}</p>
{% endif %}
{% endblock content %}
{% endblock content %}

View File

@ -5,6 +5,7 @@ import os
from django import forms
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
import tempfile
class MsgForm(forms.Form):
@ -36,7 +37,7 @@ def home(request):
'subject': subject,
'message': message,
'size': size
})
}, RequestContext(request))
def acsv(request):