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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:34:47+00:00 2026-06-03T16:34:47+00:00

My problem is that Backbone is trying to do an HTTP request on a

  • 0

My problem is that Backbone is trying to do an HTTP request on a URL with a slash at the end, like the following:

:8000/api/v1/update/2/

For some reason, Django (or tastypie) is not accepting URLs with slashes at the end, so the above URL will not work, but this URL does work:

:8000/api/v1/update/2

Backbone-tastypie falls back to oldSync, which is the original sync that comes with Backbone, when not using its overridden sync. I believe that when Backbone-tastypie uses oldSync, it appends a slash at the end of the URLs, which I do not want.

Most of the solutions being suggested are dealing with the opposite problem I have. They are trying to fix the problem where trailing slashes work, but no trailing slashes do not work.

I need to be able to support trailing slashes in addition to non-trailing slashes. This can be fixed in two ways:

  1. How do I change the backbone-tastypie code so that no AJAX calls append the slash at the end?

  2. How do I make it so that Django/tastypie will treat the above two URLs as the same?

Either one of those will fix my problem, but I cannot figure out how to implement any of them.

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

    For a Backbone solution:

    You can overwrite the default behavior of Model.url, even using the normal one and making a small modification like the one you are looking for:

    // code simplified and not tested
    var MyModel: Backbone.Model.extend({
      url: function() {
        var original_url = Backbone.Model.prototype.url.call( this );
        var parsed_url = original_url + ( original_url.charAt( original_url.length - 1 ) == '/' ? '' : '/' );
    
        return parsed_url;
      }
    });
    

    Same aplies for Collection.

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

Sidebar

Related Questions

I'm currently trying Backbone.js along with a rails app. My problem is, that I
I have the following backbone.js code and i have a problem in that event
I'm trying to do a route with backbone.js that match '/object/:id' Problem is, i
I have noticed that when multiple attributes of a Backbone model are set like
I'm trying to set up my first Backbone Model that implements RESTful WCF services.
I'm having some issues using adobe air in conjunction with backbone. The problem is
I'm having a problem that I really can't comprehend… I'm not sure if backbone
Simple problem that I can't figure out... How can I print a '%' character
The problem that I have is somehow very specific. I have to implement a
I have a strange problem that is only happening in a single location. I

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.