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 trialBenjamin Guyton
6,858 PointsViewDoesNotExist at /courses
I continue to have an error thrown when i try to run the server at /course or /admin. I removed include() from urls.py which created a strange warning line in the console, but allowed the code to proceed. But upon adding include() back in, it failed in the console. Would love the help, I really can't proceed here without access to the server and I don't know what in the code is preventing it from properly running.
4 Answers
Haydar Al-Rikabi
5,971 PointsYou have to import include as follows: from django.urls import include
Then use it to wrap courses.urls as follows: include('courses.urls')
Hasan Ahmad
6,727 Pointsshow us the urls.py
Benjamin Guyton
6,858 Pointsfrom django.conf.urls import url from django.contrib import admin
from . import views
urlpatterns = [ url(r'^courses/', 'courses.urls'), url(r'^admin/', admin.site.urls), url(r'^$', views.hello_world), ]
Hasan Ahmad
6,727 Pointswhat happens when you wrap 'courses.urls' in the include function?
Benjamin Guyton
6,858 PointsThe console returns an excessive number of errors and wont run the server
Hasan Ahmad
6,727 Pointsdo you have a urls.py file in the courses app?