Using Web2Phone with Django Templates

This guide shows you how to use Web2Phone inside plain Django templates using the standard embed snippet — no Django views or models needed.

1. Create a Web2Phone Form

  1. Create a form in the Web2Phone dashboard.
  2. Under Allowed Domains, add your Django site’s hostname (e.g. example.com, app.example.com, localhost).
  3. Save the form and copy the embed snippet.

2. Paste the Snippet into a Template

Open the template where you want your contact form (e.g. contact.html) and paste the HTML and script:

<form data-web2phone="form"
  data-public-key="YOUR_PUBLIC_KEY"
  data-endpoint="https://web2phone.co.uk/api/v1/submit/">

  <input name="name" placeholder="Your name" required>
  <input name="email" type="email" placeholder="you@example.com" required>
  <textarea name="message" placeholder="Message" required></textarea>

  <button type="submit">Send</button>
  <p data-w2p-output></p>

</form>

<script src="https://web2phone.co.uk/static/formsapp/js/embed.js"></script>

Replace YOUR_PUBLIC_KEY and the endpoint URL with the values from your own embed snippet.

3. Use It Inside Your Layout

You can drop the form into any template that extends your main layout:

<!-- contact.html -->
{% extends "base.html" %}

{% block content %}
  <h1>Contact Us</h1>

  <form data-web2phone="form"
    data-public-key="YOUR_PUBLIC_KEY"
    data-endpoint="https://web2phone.co.uk/api/v1/submit/">
    ...
  </form>

  <script src="https://web2phone.co.uk/static/formsapp/js/embed.js"></script>
{% endblock %}

Next Steps

For more examples, see the other integration guides (React, Vue, GitHub Pages, WordPress, etc.).

Troubleshooting Create Your Free Account