Quantcast

[Django] #28113: send_email module needs a name field

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Django] #28113: send_email module needs a name field

Django
#28113: send_email module needs a name field
-----------------------------------------+------------------------
               Reporter:  kinganu        |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Forms          |        Version:  1.11
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Hi, trying to create a basic contact page with django has been horrendous.
 what took me 30 minutes to do in flask takes me 3 hours to do in django
 and still doesnt work.

 Why cant I add my own fields to a contact form?  At the very least a
 contact page should have forms for :

 Name, Email, Subject, Message.

 I cannot send an email with a name variable, which blows my mind.  WTForms
 beats django forms any day, because its actually flexible.  Now I have to
 waste more time figuring out how to file a suggestion for django and fill
 this out. WOW...........pardon my frustration

 class ContactForm(forms.Form):
         name = forms.CharField(required=True, max_length=30)
         from_email = forms.EmailField(required=True)
         subject = forms.CharField(required=True, max_length=50)
         message = forms.CharField(widget=forms.Textarea, required=True,
 max_length=800)

 def contact(request):
     if request.method == 'GET':
         form = ContactForm()
     else:
         form = ContactForm(request.POST)
         if form.is_valid():
             name = form.cleaned_data['name']
             subject = form.cleaned_data['subject']
             from_email = form.cleaned_data['from_email']
             message = form.cleaned_data['message']

         try:
             recipients = ['[hidden email]']
             send_mail(name, subject, message, from_email, recipients)
         except BadHeaderError:
             return HttpResponse('Invalid header found.')
         return redirect('index')

     return render(request, "home/contact.html", {'form': form})

--
Ticket URL: <https://code.djangoproject.com/ticket/28113>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/050.116ee319368a0a4dbe62a4164886c62d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28113: send_email module needs a name field

Django
#28113: send_email module needs a name field
-------------------------------+--------------------------------------
     Reporter:  kinganu        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Forms          |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by kinganu:

Old description:

> Hi, trying to create a basic contact page with django has been
> horrendous.  what took me 30 minutes to do in flask takes me 3 hours to
> do in django and still doesnt work.
>
> Why cant I add my own fields to a contact form?  At the very least a
> contact page should have forms for :
>
> Name, Email, Subject, Message.
>
> I cannot send an email with a name variable, which blows my mind.
> WTForms beats django forms any day, because its actually flexible.  Now I
> have to waste more time figuring out how to file a suggestion for django
> and fill this out. WOW...........pardon my frustration
>
> class ContactForm(forms.Form):
>         name = forms.CharField(required=True, max_length=30)
>         from_email = forms.EmailField(required=True)
>         subject = forms.CharField(required=True, max_length=50)
>         message = forms.CharField(widget=forms.Textarea, required=True,
> max_length=800)
>
> def contact(request):
>     if request.method == 'GET':
>         form = ContactForm()
>     else:
>         form = ContactForm(request.POST)
>         if form.is_valid():
>             name = form.cleaned_data['name']
>             subject = form.cleaned_data['subject']
>             from_email = form.cleaned_data['from_email']
>             message = form.cleaned_data['message']
>
>         try:
>             recipients = ['[hidden email]']
>             send_mail(name, subject, message, from_email, recipients)
>         except BadHeaderError:
>             return HttpResponse('Invalid header found.')
>         return redirect('index')
>
>     return render(request, "home/contact.html", {'form': form})
New description:

 Hi, trying to create a basic contact page with django has been horrendous.
 what took me 30 minutes to do in flask takes me 3 hours to do in django
 and still doesnt work.

 Why cant I add my own fields to a contact form?  Why would a contact form
 ever NOT have a name field?   At the very least a contact page should have
 forms for :

 Name, Email, Subject, Message.

 I cannot send an email with a name variable, which blows my mind.  WTForms
 beats django forms any day, because its actually flexible.  Now I have to
 waste more time figuring out how to file a suggestion for django and fill
 this out. WOW...........pardon my frustration


 {{{
 class ContactForm(forms.Form):
         name = forms.CharField(required=True, max_length=30)
         from_email = forms.EmailField(required=True)
         subject = forms.CharField(required=True, max_length=50)
         message = forms.CharField(widget=forms.Textarea, required=True,
 max_length=800)

 def contact(request):
     if request.method == 'GET':
         form = ContactForm()
     else:
         form = ContactForm(request.POST)
         if form.is_valid():
             name = form.cleaned_data['name']
             subject = form.cleaned_data['subject']
             from_email = form.cleaned_data['from_email']
             message = form.cleaned_data['message']

         try:
             recipients = ['[hidden email]']
             send_mail(name, subject, message, from_email, recipients)
         except BadHeaderError:
             return HttpResponse('Invalid header found.')
         return redirect('index')

     return render(request, "home/contact.html", {'form': form})
 }}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28113#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.15e3e4976400a427ef16228f4915231d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28113: send_email module needs a name field

Django
In reply to this post by Django
#28113: send_email module needs a name field
-------------------------------+--------------------------------------
     Reporter:  kinganu        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Forms          |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by kinganu:

Old description:

> Hi, trying to create a basic contact page with django has been
> horrendous.  what took me 30 minutes to do in flask takes me 3 hours to
> do in django and still doesnt work.
>
> Why cant I add my own fields to a contact form?  Why would a contact form
> ever NOT have a name field?   At the very least a contact page should
> have forms for :
>
> Name, Email, Subject, Message.
>
> I cannot send an email with a name variable, which blows my mind.
> WTForms beats django forms any day, because its actually flexible.  Now I
> have to waste more time figuring out how to file a suggestion for django
> and fill this out. WOW...........pardon my frustration
>

> {{{
> class ContactForm(forms.Form):
>         name = forms.CharField(required=True, max_length=30)
>         from_email = forms.EmailField(required=True)
>         subject = forms.CharField(required=True, max_length=50)
>         message = forms.CharField(widget=forms.Textarea, required=True,
> max_length=800)
>
> def contact(request):
>     if request.method == 'GET':
>         form = ContactForm()
>     else:
>         form = ContactForm(request.POST)
>         if form.is_valid():
>             name = form.cleaned_data['name']
>             subject = form.cleaned_data['subject']
>             from_email = form.cleaned_data['from_email']
>             message = form.cleaned_data['message']
>
>         try:
>             recipients = ['[hidden email]']
>             send_mail(name, subject, message, from_email, recipients)
>         except BadHeaderError:
>             return HttpResponse('Invalid header found.')
>         return redirect('index')
>
>     return render(request, "home/contact.html", {'form': form})
> }}}
New description:

 Hi, trying to create a basic contact page with django has been horrendous.
 what took me 30 minutes to do in flask takes me 3 hours to do in django
 and still doesnt work.

 Why cant I add my own fields to a contact form?  Why would a contact form
 ever NOT have a name field?   Makes 0 sense to me...

 Name, Email, Subject, Message.

 I cannot send an email with a name variable, which blows my mind.  WTForms
 beats django forms any day, because its actually flexible.  Now I have to
 waste more time figuring out how to file a suggestion for django and fill
 this out. WOW...........pardon my frustration


 {{{
 class ContactForm(forms.Form):
         name = forms.CharField(required=True, max_length=30)
         from_email = forms.EmailField(required=True)
         subject = forms.CharField(required=True, max_length=50)
         message = forms.CharField(widget=forms.Textarea, required=True,
 max_length=800)

 def contact(request):
     if request.method == 'GET':
         form = ContactForm()
     else:
         form = ContactForm(request.POST)
         if form.is_valid():
             name = form.cleaned_data['name']
             subject = form.cleaned_data['subject']
             from_email = form.cleaned_data['from_email']
             message = form.cleaned_data['message']

         try:
             recipients = ['[hidden email]']
             send_mail(name, subject, message, from_email, recipients)
         except BadHeaderError:
             return HttpResponse('Invalid header found.')
         return redirect('index')

     return render(request, "home/contact.html", {'form': form})
 }}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28113#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.aaf811c49b00f4ecde8ac6c336b2cb0a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28113: send_email module needs a name field

Django
In reply to this post by Django
#28113: send_email module needs a name field
-------------------------------+--------------------------------------
     Reporter:  kinganu        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Forms          |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by kinganu:

Old description:

> Hi, trying to create a basic contact page with django has been
> horrendous.  what took me 30 minutes to do in flask takes me 3 hours to
> do in django and still doesnt work.
>
> Why cant I add my own fields to a contact form?  Why would a contact form
> ever NOT have a name field?   Makes 0 sense to me...
>
> Name, Email, Subject, Message.
>
> I cannot send an email with a name variable, which blows my mind.
> WTForms beats django forms any day, because its actually flexible.  Now I
> have to waste more time figuring out how to file a suggestion for django
> and fill this out. WOW...........pardon my frustration
>

> {{{
> class ContactForm(forms.Form):
>         name = forms.CharField(required=True, max_length=30)
>         from_email = forms.EmailField(required=True)
>         subject = forms.CharField(required=True, max_length=50)
>         message = forms.CharField(widget=forms.Textarea, required=True,
> max_length=800)
>
> def contact(request):
>     if request.method == 'GET':
>         form = ContactForm()
>     else:
>         form = ContactForm(request.POST)
>         if form.is_valid():
>             name = form.cleaned_data['name']
>             subject = form.cleaned_data['subject']
>             from_email = form.cleaned_data['from_email']
>             message = form.cleaned_data['message']
>
>         try:
>             recipients = ['[hidden email]']
>             send_mail(name, subject, message, from_email, recipients)
>         except BadHeaderError:
>             return HttpResponse('Invalid header found.')
>         return redirect('index')
>
>     return render(request, "home/contact.html", {'form': form})
> }}}
New description:

 Hi, trying to create a basic contact page with django has been horrendous.
 what took me 30 minutes to do in flask takes me 3 hours to do in django
 and still doesnt work.

 Why cant I add my own fields to a contact form?  Why would a contact form
 ever NOT have a name field?   Makes 0 sense to me...

 I cannot send an email with a name variable, which blows my mind.  WTForms
 beats django forms any day, because its actually flexible.  Now I have to
 waste more time figuring out how to file a suggestion for django and fill
 this out. WOW...........pardon my frustration


 {{{
 class ContactForm(forms.Form):
         name = forms.CharField(required=True, max_length=30)
         from_email = forms.EmailField(required=True)
         subject = forms.CharField(required=True, max_length=50)
         message = forms.CharField(widget=forms.Textarea, required=True,
 max_length=800)

 def contact(request):
     if request.method == 'GET':
         form = ContactForm()
     else:
         form = ContactForm(request.POST)
         if form.is_valid():
             name = form.cleaned_data['name']
             subject = form.cleaned_data['subject']
             from_email = form.cleaned_data['from_email']
             message = form.cleaned_data['message']

         try:
             recipients = ['[hidden email]']
             send_mail(name, subject, message, from_email, recipients)
         except BadHeaderError:
             return HttpResponse('Invalid header found.')
         return redirect('index')

     return render(request, "home/contact.html", {'form': form})
 }}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28113#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.bd0654dc8b59e5a65cd6aab6c93946c4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28113: send_email module needs a name field

Django
In reply to this post by Django
#28113: send_email module needs a name field
-------------------------------+--------------------------------------
     Reporter:  kinganu        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  closed
    Component:  Forms          |                  Version:  1.11
     Severity:  Normal         |               Resolution:  needsinfo
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by Aymeric Augustin):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 I understand that you're frustrated and I'm sorry Django doesn't work well
 for you. Perhaps you should stick with Flask or WTForms.

 I also failed to spot a question in what you wrote. If you think there's a
 bug, please clarify where you think Django is at fault and why.

 You say `Why cant I add my own fields to a contact form?` but you proceed
 to show a contact form with your own fields.

--
Ticket URL: <https://code.djangoproject.com/ticket/28113#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.61a7ea569421e01956f8354a856b6577%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28113: send_email module needs a name field

Django
In reply to this post by Django
#28113: send_email module needs a name field
-------------------------------+--------------------------------------
     Reporter:  kinganu        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  closed
    Component:  Forms          |                  Version:  1.11
     Severity:  Normal         |               Resolution:  needsinfo
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Tim Graham):

 See also TicketClosingReasons/UseSupportChannels for ways to get help with
 usage questions.

--
Ticket URL: <https://code.djangoproject.com/ticket/28113#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.0fe6942ce9b97410361fc779701040df%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Loading...