在django中如何上传文件,我的视图函数这样写的
`def create_dish(request):
form = DishForm(request.POST,request.FILES or None)
if form.is_valid():
form.save()
form = DishForm()
t = get_template('menu/create_dish.html')
c = RequestContext(request, locals())
return HttpResponse(t.render(c))
`