setting a view name when used nested_route in Django
up vote
1
down vote
favorite
I'm new to django. I want to test my ViewSet(Django = 1.11) but I got this error message.
django.urls.exceptions.NoReverseMatch: Reverse for 'license' not found. 'license' is not a valid view function or pattern name.
I want to figure out what should I put in the reverse() as parameter.
urls.py
urlpatterns += util.get_nested_route_urls(
router=router, lookup='member', domain='license', view_set=MemberLicenseViewSet,
base_name='member_license')
test.py
class MemberLicenseViewSetTestCase(APITestCase):
url = reverse("license")
factory = APIRequestFactory()
views = MemberLicenseViewSet.as_view
python django django-rest-framework
add a comment |
up vote
1
down vote
favorite
I'm new to django. I want to test my ViewSet(Django = 1.11) but I got this error message.
django.urls.exceptions.NoReverseMatch: Reverse for 'license' not found. 'license' is not a valid view function or pattern name.
I want to figure out what should I put in the reverse() as parameter.
urls.py
urlpatterns += util.get_nested_route_urls(
router=router, lookup='member', domain='license', view_set=MemberLicenseViewSet,
base_name='member_license')
test.py
class MemberLicenseViewSetTestCase(APITestCase):
url = reverse("license")
factory = APIRequestFactory()
views = MemberLicenseViewSet.as_view
python django django-rest-framework
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm new to django. I want to test my ViewSet(Django = 1.11) but I got this error message.
django.urls.exceptions.NoReverseMatch: Reverse for 'license' not found. 'license' is not a valid view function or pattern name.
I want to figure out what should I put in the reverse() as parameter.
urls.py
urlpatterns += util.get_nested_route_urls(
router=router, lookup='member', domain='license', view_set=MemberLicenseViewSet,
base_name='member_license')
test.py
class MemberLicenseViewSetTestCase(APITestCase):
url = reverse("license")
factory = APIRequestFactory()
views = MemberLicenseViewSet.as_view
python django django-rest-framework
I'm new to django. I want to test my ViewSet(Django = 1.11) but I got this error message.
django.urls.exceptions.NoReverseMatch: Reverse for 'license' not found. 'license' is not a valid view function or pattern name.
I want to figure out what should I put in the reverse() as parameter.
urls.py
urlpatterns += util.get_nested_route_urls(
router=router, lookup='member', domain='license', view_set=MemberLicenseViewSet,
base_name='member_license')
test.py
class MemberLicenseViewSetTestCase(APITestCase):
url = reverse("license")
factory = APIRequestFactory()
views = MemberLicenseViewSet.as_view
python django django-rest-framework
python django django-rest-framework
edited Nov 7 at 8:48
meshy
4,55743460
4,55743460
asked Nov 7 at 8:21
Julian Park
61
61
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185699%2fsetting-a-view-name-when-used-nested-route-in-django%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown