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!
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
Christopher ShawPython Web Development Techdegree Graduate 58,236 Points
Include not imported in urls.py
Just a note for a small issue and solution I had in the video.
My admin site came up 'Not available' after logging in as the superuser, but no error was displayed in the console. After comparing my code to the video, I noticed that when my 'learning_site' was created, include had not been imported, as it was in the video, and that the url for admin did not have the 'include'.
Before - Gave error
from django.conf.urls import url from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), ]
After - Working
from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), ]