the polls URL needs to be added to urls.py.
[image: --] Maninder Kumar [image: http://]about.me/maninder.s.kumar <http://about.me/maninder.s.kumar?promo=email_sig> On Sun, May 10, 2020 at 1:15 AM Randy Zeitvogel <randyzeitvo...@gmail.com> wrote: > This is from my mysite/settings.py file: > > # Application definition > > INSTALLED_APPS = [ > 'polls.apps.PollsConfig', > 'django.contrib.admin', > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.messages', > 'django.contrib.staticfiles', > ] > > This is from my polls/urls.py > > from django.urls import path > > from . import views > > urlpatterns = [ > path('', views.index, name='index'), > path('<int:question_id>', views.details, name='detail'), > path('<int.question_id>/results/', views.results, name='results'), > path('<int:question_id>/vote/', views.vote, name='vote'), > ] > > This is from polls/apps.py > > from django.apps import AppConfig > > > class PollsConfig(AppConfig): > name = 'polls' > > > > On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu < > nagarajusingoth...@gmail.com> wrote: > >> Dear Sir, >> >> First add your app in settings.py,then after >> URLs.py >> from django.urls import path,include >> from ur(appname) import views >> >> On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, <randyzeitvo...@gmail.com> >> wrote: >> >>> I just started working with Django in the last couple of days. >>> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1. Second >>> environment is Fedora 31, python 3.7.5, and Django 3.0.6. >>> In both cases after I create the polls app and try it out, I get this: >>> >>> Page not found (404) >>> Request Method: GET >>> Request URL: http://localhost:8000/polls/ >>> >>> Using the URLconf defined in mysite.urls, Django tried these URL >>> patterns, in this order: >>> >>> 1. admin/ >>> >>> The current path, polls/, 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. >>> >>> >>> The feedback from the development web server (python manage.py >>> runserver) is: >>> >>> >>> jango version 3.0.6, using settings 'mysite.settings' >>> Starting development server at http://127.0.0.1:8000/ >>> Quit the server with CONTROL-C. >>> Not Found: /polls/ >>> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957 >>> >>> My mysite/urls.py looks like this: >>> >>> >>> from django.contrib import admin >>> from django.urls import include, path >>> >>> urlpatterns = [ >>> path('polls/', include('polls.urls')), >>> path('admin/', admin.site.urls), >>> ] >>> >>> >>> Any help would be 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+unsubscr...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> 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+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABOHK3R9J1rHpa_M86-m70eaBkDLS0odU5R6T4JyLRTOLEO%3D3A%40mail.gmail.com.