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 Authentication Authentication LoginView

Going 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
.a{fill-rule:evenodd;}techdegree seal-36
Mark Ryan
Python Web Development Techdegree Graduate 28,648 Points

Hi, 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!

Sorry for the late reply, yes adding the import did it.