Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6648027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:36:26+00:00 2026-05-26T00:36:26+00:00

I have an HTML form in my Django web application (NOT implemented using Django

  • 0

I have an HTML form in my Django web application (NOT implemented using Django forms) that does POST request.

Now I want to implement a feature so that other web apps, not necessarily django, from different domains, can send some data to my application and get redirected to the web page with this form, partially filled with that data (the data can be JSON).

Besides redirecting, after the user clicks submit on my form, I would also want to send a message to the other server with some short text information.

I am not sure what is the best way to implement this. REST interface like Piston?

Could you give me some general directions I should follow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:36:27+00:00Added an answer on May 26, 2026 at 12:36 am

    You should create a view that handles the POST data from the form and the external web apps.

    You should be able to check whether the data you are getting in the view is coming from your site or another by checking request.META[‘HTTP_REFERER’].

    If it is from your site, you can just handle the form as you usually would.

    However if it is from an external site, you would instead render the template with the form in it. You can put the information you got from the external site into the context, so you can pre-fill the form in the template.

    You should also include a flag in the form to say that this was from an external site, something like:

    <input type="hidden" name="external_site_url" value="{{ external_site_url }}">
    

    After that form is submitted, you can check for the existence of external_site_url. If it exists you can then send the message to the other server.

    Note, because you want other apps to use your view, you’ll have to disable CSRF protection on the view (https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#csrf-protection-should-be-disabled-for-just-a-few-views).

    Also, by allowing other apps to use your view, you are opening yourself up to a lot of possible attacks. Be very careful with input validation and only give the view the ability to do the things it really needs — you don’t want an external app to be able to delete entries in your database for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web report that uses a Django form (new forms) for fields
I have a django model that I'm displaying as a form using a ModelForm.
I have a HTML form, and I have a Controller Action that accepts the
I have a html form with the data by this post method 'form id='form1'
I using Django and a generic view django.views.generic.create_update.create_object I have a model form wich
i have a django form which generates the qrcode, the form does show up
I'm using Django 1.2.4. I have an admin class for a model that has
I have created a Django app. I have a registration page(simple HTML form) in
I would like to have a custom snippet of html form code that takes
I'm using django-taggit (see here ). This is what I have: forms.py from taggit.forms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.