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 Model Administration Django's Admin

No module named 'admin': when trying to include admin URL in my urls.py, whole site crashes

So I got my courses app to show the index page, but when I am uncommenting the line with admin, I get an error ModuleNotFoundError: No module named 'admin'

urlpatterns = [
    path('', views.hello_world),
    path('admin/', include('admin.site.urls')),
    path('courses/', include('courses.urls')),
]

please help)

1 Answer

replaced the admin string with one from a fresh install

    path('admin/', admin.site.urls),

it works!