Search code examples
pythondjangotwo-factor-authentication

Page not found on Django - Empty paths


I'm trying to run this library. I downloaded and copied it on my desktop, then i tried to run it using:

py -3.7 manage.py runserver

I got:

Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

But when i go to that url i keep getting this error:

Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Using the URLconf defined in django_google_authenticator.urls, Django tried these URL patterns, in this order:

^admin/login/$
^admin/
The empty path didn't match any of these.

I don't understand what's wrong, can someone help me? Thanks in advance!


Solution

  • I think thats the normal behavour of Django, as you can see it is saying that your path didn't match any of the configured ones, like admin, so why don't you try http://127.0.0.1:8000/admin/to access Django Admin login page.

    If you want to see something different from a 404 with the base url you need to configure your urls and maybe add a redirect view, in that way when the base url is use it will redirect to your admin or other preferred page.