On 5/03/2013 2:05pm, Ana Molf wrote:
I canīš solve the follow error
The error message says you have an indentation error. That means you
need to make sure to have exactly the same quantity of indentation each
time the source code gets indented.
In practice, most people use four spaces and never use tabs.
Most text editors let you configure them to use spaces instead of tabs.
If you do that you will need to replace all tabs with your preferred
number of spaces.
Once you fix that the error will go away.
Mike
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
asunto = form.cleaned_data['asunto']
recado = form.cleaned_data['recado']
email = form.cleaned_data['email']
ccopia = form.cleaned_data['ccopia']
from django.core.mail import send_mail
send_mail(subject, mensaje, email, '[email protected]')
return HttpResponseRedirect('/gracias/')
else:
form = ContactForm(
initial={'subject': 'Me agrada su sitio!'}
)
return render(request, 'contacto_form.html', {
'form': form,
})
line 89
from django.core.mail import send_mail
^
IndentationError: unindent does not match any outer indentation level
Book code is not working https://docs.djangoproject.com/en/dev/topics/forms/
Thanks for any comment
Django 1.4.4
'Apache/2.2.16 (Debian)'
--
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.