I have the following html form in my django/python website.
<div class="contact-main">
<form action="." method="POST">{% csrf_token %}
<label for="first_name" style="margin-top: 0px;">First<span class="required">*</span></label>
{{ form.first_name }}
{{ form.first_name.errors }}
<label for="last_name">Last Name <span class="required">*</span></label>
{{ form.last_name }}
{{ form.last_name.errors }}
<label for="email">Email Address <span class="required">*</span></label>
{{ form.email }}
{{ form.email.errors }}
<label for="phone">Phone Number <span class="required">*</span></label>
{{ form.phone }}
{{ form.phone.errors }}
<label for="company">Company <span class="required">*</span></label>
{{ form.company }}
{{ form.company.errors }}
<label for="Title">Title <span class="required">*</span></label>
{{ form.title }}
{{ form.title.errors }}
<label for="message">Message</label>
{{ form.message }}
{{ form.message.errors }}
<input type="submit" value="Submit">
</form>
</div>
Now I am trying to incorporate my leads that I get from this form, to salesforce. Salesforce gave me the following script:
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <META> element to your page <HEAD>. -->
<!-- If necessary, please modify the charset parameter to specify the -->
<!-- character set of your HTML page. -->
<!-- ---------------------------------------------------------------------- -->
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <FORM> element to your page. -->
<!-- ---------------------------------------------------------------------- -->
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="00DF00000008Fp8">
<input type=hidden name="retURL" value="http://www.myurl.com">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" value="[email protected]"> -->
<!-- ---------------------------------------------------------------------- -->
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>
<label for="title">Title</label><input id="title" maxlength="40" name="title" size="20" type="text" /><br>
<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>
<label for="description">Description</label><textarea name="description"></textarea><br>
<label for="phone">Phone</label><input id="phone" maxlength="40" name="phone" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
Now I am a bit confused how to work this here. I know I need to plug in the form action, but I am worried that the django templating (aka the stuff {{ form.last_name }} ) won't work properly with this script. Any Ideas? On how to get this going would be much appreciated.