Re: Can't enter admin site
Tom is right URL regexp is one of the more difficult aspects a feel for beginners.
^ means to match the following characters at the start of the haystack
r"^"
will properly match "/admin" "/static" "/joogabooga/realm/1?x=1"
however if you are having trouble with figuring out the regexp
there is a interim fix for getting started as soon as possible, move your more complex urls to the top, urls.py is a top down match first
so instead of [
r"^$",
r"^admin"
]
try [
r"^admin",
r"^$"
]
On Friday, April 19, 2013 11:46:56 AM UTC-4, Tom Evans wrote:
On Fri, Apr 19, 2013 at 4:17 PM, Alex Lee <alexl...@gmail.com> wrote:
> Hi guys, I just started the second tutorial! I'm trying to connect to the
> admin site, but when I go to http://127.0.0.1:8000/admin after I runserver,
> I get the same "Welcome to django!" screen that I get if I would just
> connect to http://127.0.0.1:8000/. The tutorial says that the admin site is
> activated by default, but I can't access it. Is there something I'm doing
> wrong, or is there some way I can force the admin site up?
If you get exactly the same page for '/admin/' as you do for '/',
check that your urls.py is specified correctly. It will stop at the
first match, if the first view listed matches any string, you will
always get that view.
Eg, if you accidentally changed the regexp from "^$" to "^", then
every url will match that regexp.
Cheers
Tom
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home