mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix django example to work with 1.3 .
This commit is contained in:
parent
179b87639c
commit
76aef105d5
@ -62,6 +62,11 @@ MIDDLEWARE_CLASSES = (
|
|||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
FILE_UPLOAD_HANDLERS = (
|
||||||
|
"django.core.files.uploadhandler.TemporaryFileUploadHandler",
|
||||||
|
)
|
||||||
|
|
||||||
ROOT_URLCONF = 'djangotest.urls'
|
ROOT_URLCONF = 'djangotest.urls'
|
||||||
|
|
||||||
TEMPLATE_DIRS = ()
|
TEMPLATE_DIRS = ()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post" enctype='multipart/form-data'>
|
<form method="post" enctype='multipart/form-data'>
|
||||||
|
{% csrf_token %}
|
||||||
<table>
|
<table>
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
@ -14,4 +15,4 @@
|
|||||||
<p><strong>message:</strong><br>{{ message }}</p>
|
<p><strong>message:</strong><br>{{ message }}</p>
|
||||||
<p><strong>size:</strong><br>{{ size }}</p>
|
<p><strong>size:</strong><br>{{ size }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import os
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
|
from django.template import RequestContext
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
class MsgForm(forms.Form):
|
class MsgForm(forms.Form):
|
||||||
@ -36,7 +37,7 @@ def home(request):
|
|||||||
'subject': subject,
|
'subject': subject,
|
||||||
'message': message,
|
'message': message,
|
||||||
'size': size
|
'size': size
|
||||||
})
|
}, RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
def acsv(request):
|
def acsv(request):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user