示例#1
0
文件: views.py 项目: Minty2egg/mysite
def contact(request):
	if request.method == 'POST':
		form = ContactForm(request.POST)
		if form.is_valid():
			cd = form.cleaned_data
			return HttpResponseRedirect('/contact/thanks/')
	else:
		form = ContactForm(
			initial = {'subject':'I love this site.','email':'*****@*****.**'}
		)
	return render(request,'contact_form.html',{'form':form,'weixin':False})
示例#2
0
文件: views.py 项目: ramone92/django
def contact(request):
    if request.method == 'POST':
        form = ContactForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            send_mail(
                cd['subject'],
                cd['message'],
                cd.get('email', '*****@*****.**'),
                ['*****@*****.**'],
            )
            return HttpResponseRedirect('/contact/thanks/')
    else:
        form = ContactForm()
    return render_to_response('contact_form.html', {'form': form})
示例#3
0
文件: views.py 项目: srgzyq/study
def contact(request):
    if request.method == 'POST':
        form = ContactForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            send_mail(
                cd['subject'],
                cd['message'],
                cd.get('email','*****@*****.**'),
                ['*****@*****.**'],
            )
            return HttpResponseRedirect('/contact/thanks/')
    else:
        form = ContactForm()
    return render_to_response('contact_form_1.html', {'form': form})
示例#4
0
def contact(request):
    if request.method=='POST':
        form=ContactForm(request.POST)
        if form.is_valid():
            cd=form.cleaned_data
            send_mail(
                    cd['subject'],
                    cd['message'],
                    cd.get('email','*****@*****.**'),
                    ['*****@*****.**'],
                    )
            return HttpResponseRedirect('/contact/thanks/')
    else:
        form=ContactForm(initial={'subject':'I love your site.'})
    return render(request,'contact_form.html',{'form':form})
示例#5
0
def contact(request):
#  pdb.set_trace()
  if request.method=='POST':
    form=ContactForm(request.POST)
    if form.is_valid():
      ct=form.cleaned_data
      send_mail(
       ct['subject'],
       ct['message'],
       ct.get('email','*****@*****.**'),
       ['*****@*****.**'],
)
      return HttpResponseRedirect('/contact/thanks/')
  else:
    form=ContactForm(initial={'subject': 'I love your site!'})
  return render_to_response('contact_form.html',{'form':form})
示例#6
0
文件: views.py 项目: exezaid/mysite
def contact(request):
    if request.method == 'POST':
        form = ContactForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            send_mail(
                cd['subject'],
                cd['message'],
                cd.get('email', '*****@*****.**'),
                ['*****@*****.**'],
            )
            return HttpResponseRedirect('/contact/thanks/')
    else:
        form = ContactForm(
            initial = {'subject':'I love your site!'}
        )
    return render_to_response('contact_form.html', {'form': form})