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 Basics Django Templates Add a Detail View

Oprea Mihai
Oprea Mihai
5,592 Points

include()

Why this line doesn't work anymore in urls.py from learning_site ?

url(r'^admin/', include(admin.site.urls)),

I get this error :

'provide the namespace argument to include() instead.' % len(arg) django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple cont aining the list of patterns and app_name, and provide the namespace argument to include() instead. If I take out include it works but I can't connect anymore to admin

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

Have you imported include from urls?

Edit: you must have otherwise you would have a different error.

The namespace admin.site.urls should be a string enclosed in a quotation marks. See docs