Вот простейшая модель
class Pic(db.Model):
pic = db.BlobProperty()
name = db.StringProperty()
def __unicode__(self):
return self.name
class PicForm(djangoforms.ModelForm):
class Meta:
model = Pic
<form action="/file/" method="post" enctype="multipart/form-data">
<table>{{ form }}</table>
<input type="submit" value="upload"/>
</form>
def fileupload(request):
form = PicForm(request.POST, request.FILES)
if form.is_valid():
pic = request.get("pic")
name = request.get('name')
data = Pic()
data.pic = pic
data.name = name
data.put()
else:
return render_to_response('index.html', {'form': form} )