Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing / now in AngularJS #13

Open
cancan101 opened this issue Jul 5, 2014 · 2 comments
Open

Trailing / now in AngularJS #13

cancan101 opened this issue Jul 5, 2014 · 2 comments

Comments

@cancan101
Copy link

Was the "Trailing slashes allowed in the resource URLs per the Django community norm." feature added in the 1.3.x release of Django (see: https://docs.angularjs.org/api/ngResource/service/$resource and https://github.com/angular/angular.js/blob/master/CHANGELOG.md)

@cancan101 cancan101 changed the title Trailing / Trailing / now in AngularJS Jul 5, 2014
@JustinTArthur
Copy link
Contributor

Yep, assuming you mean 1.3.x of AngularJS. If its in stable, I'll incorporate their version in the next release. Thanks!

@paramburu
Copy link

@JustinTArthur I'm using django-angular to populate the apis urls in the template and django-rest-framework as an api "backend". The problem is when I'm trying to do a query or a get without the id, it leaves two trailing slashes resulting in a 404 Not Found.

In this case, django-angular creates the following model-list and model-detail urls:

  • "/api/app/model/.:format"
  • "/api/app/model/:pk/.:format"

I thought I should be able to use model-detail as the main url because it should simply ignore empty parameters but instead is making a GET request to "/api/app/model//" (two slashes) resulting in 404. I think the :format parameter might be the problem here.

For now I can hardcode the url "/api/app/model/:pk" or "/api/app/model/:pk/" and it works but for simplicity I would prefer using django-angular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants