Closed besenthil closed 9 years ago
Team,
I am pretty much stuck with this issue.
NoReverseMatch at /angular/reverse/ Reverse for 'check_url' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'$check_url/$']
And my settings.py looks like this
INSTALLED_APPS = ( ................. 'djangular', )
MIDDLEWARE_CLASSES = ( 'djangular.middleware.DjangularUrlMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
In my html, i have included
and I use the controller...
<div ng-controller="SignupController"> </div>
and in my controller javascript, I make this call
myapp.controller('SignupController', ['$scope','$http','djangoUrl',function($scope, $http, djangoUrl) { $scope.checkEmailAvailability = function() { console.log('Called'); var fetchItemURL = djangoUrl.reverse('gateway:check_url'); console.log(fetchItemURL); $http.get(fetchItemURL).success(function(item) { console.log('Fetched item: ' + item); }).error(function(msg) { console.error('Unable to fetch item. Reason: ' + msg); }); } $scope.checkEmailAvailability(); }]);
How can I make django use /angular/reverse in my urls? Am I doing something wrong here?
Closing the issue as it got resolved once I changed my urls. py by removing the $
old url(r'^$', include('gateway.urls',namespace="gateway")), new url(r'^', include('gateway.urls',namespace="gateway")),
Team,
I am pretty much stuck with this issue.
NoReverseMatch at /angular/reverse/ Reverse for 'check_url' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'$check_url/$']
And my settings.py looks like this
INSTALLED_APPS = ( ................. 'djangular', )
MIDDLEWARE_CLASSES = ( 'djangular.middleware.DjangularUrlMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
In my html, i have included
and I use the controller...
and in my controller javascript, I make this call
myapp.controller('SignupController', ['$scope','$http','djangoUrl',function($scope, $http, djangoUrl) { $scope.checkEmailAvailability = function() { console.log('Called'); var fetchItemURL = djangoUrl.reverse('gateway:check_url'); console.log(fetchItemURL); $http.get(fetchItemURL).success(function(item) { console.log('Fetched item: ' + item); }).error(function(msg) { console.error('Unable to fetch item. Reason: ' + msg); }); } $scope.checkEmailAvailability(); }]);
How can I make django use /angular/reverse in my urls? Am I doing something wrong here?