2007-05-10 21:46:15 +08:00
|
|
|
from django.core.mail import EmailMessage, SMTPConnection
|
Merged Unicode branch into trunk (r4952:5608). This should be fully
backwards compatible for all practical purposes.
Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04 20:11:04 +08:00
|
|
|
from django.http import HttpResponse, HttpResponseServerError
|
2007-05-10 21:46:15 +08:00
|
|
|
from django.shortcuts import render_to_response
|
|
|
|
|
|
|
|
def no_template_view(request):
|
|
|
|
"A simple view that expects a GET request, and returns a rendered template"
|
|
|
|
return HttpResponse("No template used")
|
|
|
|
|
Merged Unicode branch into trunk (r4952:5608). This should be fully
backwards compatible for all practical purposes.
Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04 20:11:04 +08:00
|
|
|
def file_upload_view(request):
|
|
|
|
"""
|
|
|
|
Check that a file upload can be updated into the POST dictionary without
|
|
|
|
going pear-shaped.
|
|
|
|
"""
|
|
|
|
form_data = request.POST.copy()
|
|
|
|
form_data.update(request.FILES)
|
|
|
|
if isinstance(form_data['file_field'], dict) and isinstance(form_data['name'], unicode):
|
|
|
|
return HttpResponse('')
|
|
|
|
else:
|
|
|
|
return HttpResponseServerError()
|
|
|
|
|