Opened 12 years ago

Closed 12 years ago

Last modified 6 years ago

#2673 closed defect (invalid)

URL matching in tutorial fails

Reported by: dave@… Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I'm going through the tutorial at, but when I activate the admin site and visit the admin page, I see:

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. /django-test/admin/

The current URL, /django-test/admin/, didn't match any of these.

which seems a little perverse given how trivially the url does, in fact, match. Granted I'm running the server on a remote machine rather than using the development server, but this should work, shouldn't it?

Change History (5)

comment:1 Changed 12 years ago by serbaut

The leading / shouldnt be part of the pattern afaik. Confusing error message i agree.

comment:2 Changed 12 years ago by James Bennett

Have you uncommented the line in the project's for the admin URL setup (as directed at the top of tutorial 2)?

comment:3 Changed 12 years ago by dave@…

Yes, I did uncomment the line un
I tried to use it as-is, but it didn't match. I assume that was becase my project is located at

rather than sitting right at the root of my server. So I changed the pattern from




As for the leading slash, it is present in the code generated by django in its initial, but I also tried without it and got the same result.

comment:4 Changed 12 years ago by dave@…

Resolution: invalid
Status: newclosed

Nevermind; I tried again without the leading slash and now I'm in business. Sorry for the noise!

comment:5 Changed 6 years ago by anonymous

Easy pickings: unset
UI/UX: unset

I am having the same problem, But that fix isn't working. It was working last night when I went to sleep, now I have no idea what is wrong :(

Note: See TracTickets for help on using tickets.
Back to Top