splitforms.com

Contact form · Django

Contact form for Python and Django

Add a working contact form to your Django templates or views in minutes. Post directly from the browser or forward via Python requests — no SMTP credentials, SendGrid setup, or background Celery tasks needed. Free tier includes 500 submissions a month and smart spam filtering.

  • 500 free / month
  • One endpoint
  • No backend code
Django contact form — copy-paste code for splitforms

Key benefits

No backend code

No server, API route, or SDK. Your Django form posts straight to one endpoint.

Straight to your inbox

Every Django submission is emailed to you and saved in a searchable dashboard, with spam filtered out first.

Design without limits

It's your own Django markup and styles. Splitforms is only the backend, so nothing constrains how the form looks.

Copy-paste ready

Your Django contact form, ready to paste.

Replace YOUR_ACCESS_KEY with the key from your dashboard — that's the whole integration. No SDK to install, no build step, just the html you already write.

contact.html
<!-- templates/contact.html (Django template) -->
<!-- Direct HTML form posting to Splitforms. No custom view or SMTP setup needed! -->
<form action="https://splitforms.com/api/submit" method="POST">
  <!-- Splitforms access key -->
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />

  <!-- Form fields -->
  <label for="id_name">Name</label>
  <input type="text" id="id_name" name="name" placeholder="Your name" required />

  <label for="id_email">Email</label>
  <input type="email" id="id_email" name="email" placeholder="you@example.com" required />

  <label for="id_message">Message</label>
  <textarea id="id_message" name="message" rows="4" placeholder="Your message..." required></textarea>

  <!-- Honeypot for spam bot detection (hidden from real users) -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off" />

  <button type="submit">Send Message</button>
</form>

How to add it

How to add a contact form to a Django website.

To add a contact form to a Django website you need three things: a free splitforms access key, the html snippet above, and your key pasted into it. No backend, server, or SDK — the form posts to one URL and every submission lands in your inbox and dashboard.

  1. Get your free splitforms access key

    Sign up, verify your email and copy the access key you will paste into your Django form. No credit card required.

  2. Drop the Django snippet into your project

    Copy the Django code example into your project and replace YOUR_ACCESS_KEY with the key from step 1.

  3. Receive submissions in your dashboard

    Submissions arrive in the splitforms dashboard within seconds. Free includes owner email notification attempts; Pro adds Slack, Discord, Sheets, or any signed webhook URL.

Where submissions go

Where do your Django form submissions go?

Every submission is emailed to you and saved to a searchable dashboard — spam filtered before it ever reaches you. Search, export to CSV, or forward it to a webhook or Slack on Pro.

  • 500 submissions a month, free to start
  • Honeypot + automatic spam scoring on every plan
  • Signed webhooks to Slack, Discord, your server
Django contact form submissions in the splitforms dashboard

No backend needed

Do you need a backend for a Django form? No.

Your Django form posts standard FormData to one URL. Splitforms validates the access key, runs its spam checks, and forwards it to your email — so there's no server, API route, or database for you to build or maintain.

  • Direct client-side or server-side forwarding via request.POST
  • No SMTP credentials, SendGrid keys, or Celery workers to configure
  • Built-in honeypot spam protection and free dashboard tracking
How splitforms processes a Django form submission

Best practices

What a production-ready Django form needs.

What separates a Django form that works in a demo from one that holds up on launch day, most important first.

  • Store YOUR_ACCESS_KEY in django.conf.settings or environment variables if forwarding through Django views.
  • Configure Allowed Domains in your splitforms dashboard and turn on strict origin protection so browser submissions only come from your Django site. A server-side relay sends no Origin header, so leave strict mode off if you forward from a Django view.
  • Add a custom /thanks/ redirect URL in your form settings or as a hidden input redirect field.
Production-ready Django contact form best practices

Questions

Django contact form questions.

Anything missing? Email us, we read every message.

A person reading answers to common questions
How do I create a contact form in Django without setting up SMTP?

Point your Django template's form action directly to https://splitforms.com/api/submit with your access key. Splitforms handles receiving the POST, storing submissions in your dashboard, filtering spam, and alerting you via email — zero mail server configuration required.

Can I validate form fields using Django's forms.Form first?

Yes. Post the form to your normal Django view, validate with form.is_valid(), and forward form.cleaned_data along with access_key to https://splitforms.com/api/submit using requests.post().

Do I need {% csrf_token %} when posting directly to Splitforms?

No. Direct browser posts to https://splitforms.com/api/submit are external cross-origin POST requests authenticated by your access_key. Django's CSRF middleware only checks requests posted to your own Django server routes.

How does spam protection work with Django contact forms on Splitforms?

Splitforms provides an invisible honeypot field (botcheck) and automated rule-based spam detection. Submissions with filled honeypots or spam indicators are filtered into a Spam tab without annoying your human visitors with CAPTCHA puzzles.

Django's {% csrf_token %} is not needed for external POSTs

When your HTML <form action="https://splitforms.com/api/submit"> posts directly to Splitforms from the visitor's browser, you do not need Django's {% csrf_token %} tag. Splitforms authenticates via the access_key field in the payload. However, if you submit to your own Django view first before forwarding, keep {% csrf_token %} in your template.

Honeypot field should never be visible to legitimate visitors

Ensure the botcheck input remains hidden (display:none and tabindex="-1"). Bots parse and populate hidden inputs indiscriminately, while human visitors leave it empty.

Show 1 more questions
Timeout handling in server-side requests

When using requests.post() in a Django view to relay submissions, always provide an explicit timeout=5 argument to avoid tying up WSGI/ASGI worker threads if there is network latency.

View all FAQs

Ship your Django contact form in 60 seconds.

Free for 500 submissions a month on your Django site. Pro at $5/mo adds Slack alerts, signed webhooks and file uploads when you need them.

  • No credit card required
  • 500 free submissions
  • Setup in minutes
Two people celebrating a working contact form