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)
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.