Code

Opened 8 years ago

Closed 8 years ago

Last modified 2 years ago

#2673 closed defect (invalid)

URL matching in tutorial fails

Reported by: dave@… Owned by: adrian
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

Description

I'm going through the tutorial at http://www.djangoproject.com/documentation/tutorial2/, 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?

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by serbaut

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

comment:2 Changed 8 years ago by ubernostrum

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

comment:3 Changed 8 years ago by dave@…

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

https://boost-consulting.com:8443/django-test

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

r'/admin/'

to

r'/django-test/admin/'

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

comment:4 Changed 8 years ago by dave@…

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:5 Changed 2 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 :(

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.