# Error:404 Page not found

**URL:** <https://forum.djangoproject.com/t/error-404-page-not-found/14396>\
**Category:** Getting Started\
**Created:** [June 20, 2022, 1:11pm UTC](https://forum.djangoproject.com/t/error-404-page-not-found/14396 "2022-06-20T13:11:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![djangoelite](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/djangoelite/32/8969_2.png) [@djangoelite](https://forum.djangoproject.com/u/djangoelite)\
**Post date:** [June 20, 2022, 1:11pm UTC](https://forum.djangoproject.com/t/error-404-page-not-found/14396/1 "2022-06-20T13:11:25Z")

</div>

Hi All,  
This is my first post here, so apologize in advance if I am not providing all the information. But I inherited this project from a different team and trying to run this django project using pycharm and getting 404 Page not found. I have set the Debug to True to see the error and below is what I see on the page

# Page not found (404)

| Request Method: | GET |
| --- | --- |
| Request URL: | [http://127.0.0.1:8000/](http://127.0.0.1:8000/) |

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

1. api/v1/account/
2. api/v1/authentication/
3. api/v1/franchises/
4. api/v1/jurisdictions/
5. api/v1/registration/
6. api/v1/reports/
7. api/v1/schedules/
8. api/v1/trades/
9. api/v1/contact-types/
10. api/v1/inspection-types/
11. api/v1/documents/
12. api/v1/dashboards/
13. api/v1/vocabularies/
14. api/v1/fees/
15. api/v1/activities/
16. api/v1/search/
17. api/v1/stripe/
18. api/v1/messages/
19. api/v1/projects/
20. api/v1/tickets/
21. api/v1/project\_activities/
22. api/v1/project\_documents/
23. api/v1/notes/
24. api/v1/inspections/
25. api/v1/conditions/
26. api/v1/form\_setup/
27. site\_administrator\_panel/
28. ^user-activation/(?P[-:\w]+)/$ [name=‘account\_confirm\_email’]
29. sentry-debug/
30. api/v1/documentation/ [name=‘schema-redoc’]
31. ^static/(?P.\*)$
32. ^media/(?P.\*)$

The empty path didn’t match any of these.

You’re seeing this error because you have `DEBUG = True` in your Django settings file. Change that to `False`, and Django will display a standard 404 page.

Below is my projects URL.py code

```auto
import re
from django.conf import settings
from django.contrib import admin
# from django.contrib.staticfiles.views import serve
from django.urls import include, re_path
from django.urls import path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from django.conf.urls.static import static
from django.views.generic import TemplateView

urlpatterns = [

    path('api/v1/account/', include('accounts.urls')),
    path('api/v1/authentication/', include('accounts.authentication_urls')),
    path('api/v1/franchises/', include('franchises.urls')),
    path('api/v1/jurisdictions/', include('jurisdictions.urls')),
    path('api/v1/registration/', include('accounts.registration_urls')),
    path('api/v1/reports/', include('reports.urls')),
    path('api/v1/schedules/', include('scheduling.urls')),
    path('api/v1/trades/', include('trades.urls')),
    path('api/v1/contact-types/', include('contact_types.urls')),
    path('api/v1/inspection-types/', include('inspection_types.urls')),
    path('api/v1/documents/', include('documents.urls')),
    path('api/v1/dashboards/', include('dashboards.urls')),
    path('api/v1/vocabularies/', include('vocabularies.urls')),
    path('api/v1/fees/', include('fees.urls')),
    path('api/v1/activities/', include('activities.urls')),
    path('api/v1/search/', include('search.urls')),
    path('api/v1/stripe/', include('stripe_api.urls')),
    path('api/v1/messages/', include('admin_messages.urls')),
    path('api/v1/projects/', include('projects.urls')),
    path('api/v1/tickets/', include('tickets.urls')),
    path('api/v1/project_activities/', include('projects_activities.urls')),
    path('api/v1/project_documents/', include('projects_documents.urls')),
    path('api/v1/notes/', include('notes.urls')),
    path('api/v1/inspections/', include('inspections.urls')),
    path('api/v1/conditions/', include('conditions.urls')),
    path('api/v1/form_setup/', include('form_setup.urls')),
    path('site_administrator_panel/', admin.site.urls),
    re_path(r"^user-activation/(?P<key>[-:\w]+)/$", TemplateView.as_view(), name="account_confirm_email"),

]

# API documentation
schema_view = get_schema_view(
    openapi.Info(
        title='Dashboard API',
        default_version='v1',
        description='Dashboard API',
        terms_of_service='https://www.google.com/policies/terms/',
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

def trigger_error(request):
    division_by_zero = 1 / 0
    assert division_by_zero

urlpatterns += [
    path('sentry-debug/', trigger_error),
    path(
        'api/v1/documentation/',
        schema_view.with_ui('redoc', cache_timeout=0),
        name='schema-redoc',
    ),
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

```

I am expecting to see Django login page to login using the superuser. Any advices would be appreciated 😉

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 20, 2022, 1:23pm UTC](https://forum.djangoproject.com/t/error-404-page-not-found/14396/2 "2022-06-20T13:23:48Z")

</div>

How much of a Django background do you have? Knowing that may help us to more properly target an answer.

The simple and direct answer is that you don’t have an entry in your urlpatterns for an empty url. That’s something for you to provide.

You also need to decide what the behavior of that empty url page is going to be. You say that you want it to be a login page, but do you want that page to appear every time you go to that URL? Even if you’re already logged in?

You may want to review the docs at [User authentication in Django | Django documentation | Django](https://docs.djangoproject.com/en/4.0/topics/auth/) and [Using the Django authentication system | Django documentation | Django](https://docs.djangoproject.com/en/4.0/topics/auth/default/#module-django.contrib.auth.views)

---

<div class="post-metadata">

**Author:** ![djangoelite](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/djangoelite/32/8969_2.png) [@djangoelite](https://forum.djangoproject.com/u/djangoelite)\
**Post date:** [June 20, 2022, 2:44pm UTC](https://forum.djangoproject.com/t/error-404-page-not-found/14396/3 "2022-06-20T14:44:28Z")

</div>

Thank you for your review. I am a beginner with Django with no experience. I have done some tutorials and learning programs and just getting my hands wet at the moment. Like I said, I inherited this project and would like to run this on my machine for local development and testing. I would just like to make sure that when I do “python manage.py runserver”, it opens a page where I can at least access the admin page or something and not a 404 error.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 20, 2022, 2:49pm UTC](https://forum.djangoproject.com/t/error-404-page-not-found/14396/4 "2022-06-20T14:49:04Z")

</div>

If you look at your urls, you’ll see that you _do_ have a url defined for the admin system. That’s the url you would use in your browser to access those pages.

Also, I strongly suggest (if you haven’t done so already) to work your way through either (or both) of the [Official Django Tutorial](https://docs.djangoproject.com/en/4.0/intro/tutorial01/) and the [Django Girls Tutorial](https://tutorial.djangogirls.org/en/). They each cover the essentials that you should learn when starting with Django.

---

<div class="post-metadata">

**Author:** ![djangoelite](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/djangoelite/32/8969_2.png) [@djangoelite](https://forum.djangoproject.com/u/djangoelite)\
**Post date:** [June 20, 2022, 3:38pm UTC](https://forum.djangoproject.com/t/error-404-page-not-found/14396/5 "2022-06-20T15:38:53Z")

</div>

Ah, it does work when I go to [http://127.0.0.1:8000/site\_administrator\_panel](http://127.0.0.1:8000/site_administrator_panel). I could have sworn I already tried that, but perhaps, I made a type somewhere earlier when I tried. Thank you so much and also I will go through the tutorials you have suggested there. Appreciate your advice!
