Friday, December 29, 2017

404 for some matching urls too (Version 2)

I do not know the mistake I am likely to be committing. In Django Version 2, I have a feeling that URL matching fails whenever there are query variables. 

When I try to log into Admin module, the login screen comes. But when a 'next' query variable is attached, I get a 404. Similarly when I try to jump to a page in the records listing, I get 404. (Color has been added for highlighting)

http://localhost:8000/admin/login/?next=/admin/

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

admin/ [name='index']
admin/ login/ [name='login']
admin/ logout/ [name='logout']
admin/ password_change/ [name='password_change']
admin/ password_change/done/ [name='password_change_done']
admin/ jsi18n/ [name='jsi18n']
admin/ r/<int:content_type_id>/<path:object_id>/ [name='view_on_site']
...... (corresponds to the tables defined)
admin/ ^(?P<app_label>rsi|auth)/$ [name='app_list']
login/ [name='login']
logout/ [name='logout']
authissue [name='authissue']
.....

The current path, admin/login/?next=/admin/, didn't match any of these.

Any help is appreciated.



--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/89e14511-03d3-43e8-9603-0aaccdf7ca91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment