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 8092393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:16:27+00:00 2026-06-05T20:16:27+00:00

I am trying to send a ajax request to my views.py but I dont

  • 0

I am trying to send a ajax request to my views.py but I dont know how to use the path.
My views is located on my server at /home/pycode/main/main/apps/builder/views.py.
The page I am sending the request from is located at /home/dbs/www/python.html
Do I need to add something to my urls.py?

views.py

#!/usr/bin/env python26
from django.http import HttpResponse
def main(request):
    return HttpResponse("from python with love")

python.html jquery ajax

<script language="JavaScript">
$(document).ready(function() {
$("#myform").submit(function() {

    var myCheckboxes = new Array();
    $("input:checked").each(function() {
       myCheckboxes.push($(this).val());
    });
    $.ajax({
        type: "POST",
        url: '/main',
        data: { myCheckboxes:myCheckboxes },
        success: function(response){
            alert(response);
        }
    });
    return false;
});
});
</script>
  • 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-05T20:16:28+00:00Added an answer on June 5, 2026 at 8:16 pm

    To access functions in views you refer to them through their entries in urls.py never through their location in the filesystem.

    Going through the django tutorial (4 pages) will help immensely.

    https://docs.djangoproject.com/en/dev/topics/http/urls/

    in urls.py you map a url to a function using an entry similar to:

    urlpatterns = patterns('',
        (r'^main/$', 'apps.builder.views.main'),
    )
    

    Then whenever you type ‘/main/` as a url it maps to your view function.

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

Sidebar

Related Questions

I am trying to send use Ext.Ajax.request method to delete some data on server.
I was trying to send an ajax request as POST request. But when i
I am trying to send a simple ajax post request using Mootools but I'm
I'm trying to send data with AJAX to a Node.js server but keep bumping
I'm trying to send a JSON object from an AJAX request to my server.
So, what i'm trying to do is to send an AJAX request, but as
Ok so I know long hand ajax but trying to use the jQuery short
I am trying to send a AJAX request to the server when a user
I am trying to send a json RPC ajax request when the page is
I am trying to send email using AJAX and PHP but no success:( My

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.