I've been spending many hours trying to find a way to upload images in Django.
If you want to upload it to models it's very easy, but as soon as you don't want models it's impossible, which is weird since it's integrated in the models. Any other framework would have a simple integrated solution. I've looked for plugins, same thing, impossible to find one.
Here is the admin view I added:
class ImageUploadForm(forms.Form):
image = forms.ImageField()
@staff_member_required
def uploadImage(request):
if request.method == 'POST':
form = ImageUploadForm(request.POST, request.FILES)
if form.is_valid() and form.is_multipart():
return HttpResponse('so now what?')
context = { 'form': form }
return render_to_response('blogs/admin/upload.html', context, RequestContext(request))
So my question: Is there an easy way to upload images with Django without using models?