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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:45:27+00:00 2026-05-27T08:45:27+00:00

I have following settings URL urlpatterns = patterns(”, (r’^media/(?P<path>.*)$’, ‘django.views.static.serve’, {‘document_root’: settings.STATIC_DOC_ROOT}), url(r’^index/$’,’pMass.views.index’, name=’index’),

  • 0

I have following settings

URL

urlpatterns = patterns('',
   (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}),
    url(r'^index/$','pMass.views.index', name='index'),
    url(r'^index/(?P<match>\d+)/(?P<tab>\d)$', 'pMass.views.detail',name='detail'),

VIEW

def index(request):
    error = False
    cid = request.GET

    if 'cnum' in request.GET:
       cid = request.GET['cnum']

    if not cid:
       error = False
       expcount = Experiment.objects.count()
       allmass = SelectedIon.objects.count()

    else:

        defmass = 0.000001
        massvalue = float(cid)
        masscon = defmass * massvalue
        highrange = massvalue + masscon
        lowrange = massvalue - masscon

        myquery = SelectedIon.objects.select_related().filter(monoiso__range=(lowrange, highrange))
        querycount = myquery.count()

        return render_to_response('queryresult1.html', {'query': cid, 'high':highrange, 'low':lowrange, 'sections':myquery, 'qcount':querycount, })


    return render_to_response('index.html', {'error': error, 'exp': expcount,'mass':allmass,})


def detail(request,  match, tab):
    monorecord = get_object_or_404(SelectedIon, monoiso=match)
    detailrec = SelectedIon.objects.filter(monoiso=monorecord)
    return render_to_response('queryresult1.html', {"id": monorecord, "detail": detailrec}, context_instance=RequestContext(request))

Template // from where I am trying to send request

$("td a").bind("click", function(event){

        var str = $(this).attr('id');
        tab = $("ul.tabs li").find("a").attr('id');
        mapurl = 'match/'+ str+ '/tab/'+ tab;

        new $.ajax({
        url: mapurl,
        async: true,
        // The function below will be reached when the request has completed
        success: function(transport)
        {
            $("#result").html(transport); // Put data in the div
            $("result").fadeIn();        // Fade in the active content
        }
    });

I am trying to send ajax request to server and get result back in the same queryresult1.html template (result containter). But, I am getting problem in my request

`Error`     [11:18:37.814] GET http://127.0.0.1:8000/index/match/622/tab/1 [HTTP/1.0 404 NOT FOUND 59ms]

I think my url configuraton is right? How can I solve my ajax request from template with it’s corresponding url and view?

  • 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-27T08:45:28+00:00Added an answer on May 27, 2026 at 8:45 am

    This has nothing to do with Ajax.

    You are requesting the URL index/match/622/tab/1. But your URLconf is expecting index/622/1 – no ‘match’ or ‘tab’.

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

Sidebar

Related Questions

If I have following url conf: urlpatterns = patterns('', url(r'^projects-json$', 'projects.views.list'), ) And I
I have the following django model: RESOURCE_DIR = os.path.join(settings.MEDIA_ROOT, 'resources') class Resource(models.Model): title =
I have the following code: private static void WriteStartupInfo() { Settings settings = Settings.Default;
in my settings.py I have the following: PROJECT_DIR = os.path.dirname(os.path.realpath(__file__)) MEDIA_ROOT = os.path.join(PROJECT_DIR,'templates') MEDIA_URL
I have the following code in my settings.py file MEDIA_ROOT_PATH = MEDIA_FILES = os.path.join(PROJECT_ROOT,
I'm having trouble loading CSS for my Django template. I have the following settings:
if i have the following Url.Action(Index, Settings); How do ensure that the url is
I have created a sitecollection and in AAM I have made following settings for
I have a settings bundle in my iPhone app, with the following PList: Type:
I have a table with sets of settings for users, it has the following

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.