Try this in your view:

from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response

from models import Document
from forms import DocumentForm


def index(request):
    if request.method == 'POST':
        form = DocumentForm(request.POST, request.FILES)
        if form.is_valid():
          form.save()
        return render_to_response('index.html', {'form': form},
context_instance=RequestContext(request)
    )

    return render_to_response('index.html', { 'form': DocumentForm() },
context_instance=RequestContext(request)



On Sat, Apr 20, 2013 at 2:24 AM, Hélio Miranda <[email protected]> wrote:

> My whole code including the settings are here:
> http://plnkr.co/edit/neqmvI13prMySMtHQHta
>
> And my structure is this:
>
>
> <https://lh6.googleusercontent.com/-E8UsNS5uj-g/UXGLk8W9_aI/AAAAAAAAAAY/kC8tTD4QLJg/s1600/Sem+T%C3%ADtulo.png>
>
> What do you think could be wrong?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to