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 trialCharles Parmley
4,394 PointsGoing nuts on correct usage of django's auth, what is the correct usage?
What is incorrect in the code?
from django.conf.urls import url, include
from . import views
urlpatterns = [
path(r"^accounts/", include("django.contrib.auth.urls"))
]
2 Answers
Mark Ryan
Python Web Development Techdegree Graduate 28,648 PointsHi, Charles! I don't have full access to the challenge but I'll give this a shot anyway. It looks like you're grasping the objective here which is to include url paths from Django's built-in authentication.
You're using path but you haven't imported it yet. However, this challenge has already imported url for you. You'll probably have to work with that instead to make this pass. Also, from what I can see, it looks like they're asking for these included paths to be mapped to a specific path of r"^"
.
I'd recommend taking a quick glance at these two versions of the docs below to see how Django has offered path as a syntactically simpler version of url. Note where regex is and is not used.
Hope this helps!
Charles Parmley
4,394 PointsSorry for the late reply, yes adding the import did it.