Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django REST Framework Make the REST Framework Work for You Viewsets and Routers

Django 2.0 Error: 'Specifying a namespace in include() without providing an app_name '

In Django 2.0 , I should specify app_name in order for routing to work, re_path(r'^api/v2/', include(router.urls, namespace='apiv2')), should I define it this way ?

re_path(r'^api/v2/', include((router.urls,'apiv2'), namespace='apiv2')),

Can you please provide more explanation

1 Answer

I found a similar question with a valid answer here:

https://teamtreehouse.com/community/include-namespace

Note: Works for V3 as well when I was doing this course.