Questions in Contact us function( Django)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kang jia
    New Member
    • Jun 2007
    • 88

    Questions in Contact us function( Django)

    hi

    currently, i am using Django to create webpage, in view.py the code is in the following:

    [code=python]

    def contact(request ):
    if request.method == 'POST':
    form = ContactForm(req uest.POST)
    if form.is_valid() :
    # Do form processing here...
    return HttpResponseRed irect('/on_success/')
    else:
    form = ContactForm()
    return render_to_respo nse('contactus. html', {'form': form})

    def success(request ):
    return render_to_respo nse("on_success .html")
    [/code]

    in my form.py , it is like this:
    [code=python]
    class ContactForm(for ms.Form):
    subject = forms.CharField (max_length=100 )
    message = forms.CharField ()
    sender = forms.EmailFiel d()
    cc_myself = forms.BooleanFi eld(required=Fa lse)
    [/code]

    but i don not understand where is the Email is sent to as there is only sender's Email address, where to configure the receiver email address and how to configure the Mail server? i am very new to Django framework, just pick it up and learning in the process, can anyone help me to understand and smooth of application, thanks in advance :)
    Last edited by bartonc; Nov 4 '07, 03:50 PM. Reason: code=python not code:python
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    I'm guessing that Python does not need to be aware of the sending address.
    That's most likely handled by PHP or HTML.

    Comment

    • kang jia
      New Member
      • Jun 2007
      • 88

      #3
      Originally posted by bartonc
      I'm guessing that Python does not need to be aware of the sending address.
      That's most likely handled by PHP or HTML.
      hi

      but the filed is sender so this means it is sender's email address, right? then i am wondering where is receiver's address? so where this email is sending to??

      Comment

      Working...