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

  • Home
  • SEARCH
  • 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 8227779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:14:31+00:00 2026-06-07T16:14:31+00:00

I have a website running on Django. When a user clicks a submit button,

  • 0

I have a website running on Django. When a user clicks a submit button, I need to send data to a server running on a different domain and then display the data returned to the user. I can’t use an Ajax request because of the cross-domain issue. Lots of sources suggest that I should use Javascript to send to my own server which should then send to the external server, but I don’t see how I would implement that.

  • 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-06-07T16:14:34+00:00Added an answer on June 7, 2026 at 4:14 pm

    If you submit the URL that the form eventually needs to go to, you can do the processing on the server side. So say you include a hidden field in the form like so:

    <input type="hidden" name="form_urlfield" value="http://anotherwebsite.com/wheretheformneedstogo">
    

    Basically you can do something like:

            $.ajax({
        type: "POST",
        url: 'http://somewhereonthesameserver.com/submit-form',
        data: $('#ajax-form').serialize(),
        success: function(data){...},
                });
    

    Then, in the view that corresponds to your submit-form URL:

    import urllib2
    data = urllib2.urlopen(request.POST['form_urlfield'], the_post_data)
    //the_post_data is the data that you want to post to the other server..
    // do something with the returned data
    // return a JSON/Other response
    

    Also, make sure you enable the CSRF-Ajax functionality in Django.
    https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#csrf-ajax

    All of the above is just pseudo-code (I just wrote it out here..) but it should give you an idea on how to proceed. Hope this helps 🙂

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

Sidebar

Related Questions

I have a website running ASP.NET (C#) on server A . I need my
I have a database driven website built with Django running on a Linux server.
I have a website that is running on a server. I want to get
I have a server and a website running 100% fine. The thing is, I
I have a ASP.NET 3.5 website running on Windows Server 2003 and I'm using
I have this ASP.NET/SQLServer2005 website running on a production server (Win2003, QuadCore, 4GB). The
I have a website running on a IIS 7.5 server with ASP.NET 4.0 on
I have a website running on a Windows 2008 R2 server, using a SQL
I have a website running on an Amazon EC2 Linux server, and everything works
I have a website running on FreeBSD server. Users can visit this website and

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.