url(r'^vote/thank/(?<your_email> #here should be RE catching the email )$', views.thank),
def thank(request, your_email=None):
c = {"thanks_body": "thanks_body view"}
c["his_email"] = your_email
return render(request, "thanks.html", c)url(r'^vote/thank/(?<your_email>^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$ ', views.thank),--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b84874c3-32ad-47fb-82db-5e48b87a975d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
url(r'^vote/thank/$', views.thank),
def vote(request):
if request.method == "POST":
form = polls.forms_DK.NameForm(request.POST)
if form.is_valid():
your_email = form.cleaned_data["your_email"]
ratio = str(form.cleaned_data["ratio"])
adress = "thank/?email="+your_email+"/" # here I make the URL
return HttpResponseRedirect(adress)
else:
form = polls.forms_DK.NameForm()
django.setup()
all_restaurants = Restaurant.objects.all()
return render(request, "vote_form.html", {"all_restaurants": all_restaurants, "form": form})
def thank(request, your_email=None): # I don't need your_email=None
c = {"thanks_body": "thanks_body view"} # I can rearenge the dictonary
remail = request.GET["email"] #here I pick up the email
c["thanks_body"] = remail
return render(request, "thanks.html", c)