Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.