Where is your polls/views.py???

It should at least return HttpResponse

From: django-users@googlegroups.com <django-users@googlegroups.com> On Behalf 
Of tejasri mamidi
Sent: Sunday, 10 May 2020 08:13
To: django-users@googlegroups.com
Subject: Re: Tutorial Part 1

 

Change mysite.urls ,

Path(' ',include('polls.url'))...

 

You were not created any polls function your view and and not import any polls 
view in your mysite.urls

 

On Sun, May 10, 2020, 01:15 Randy Zeitvogel <randyzeitvo...@gmail.com 
<mailto: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 <http://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 
<mailto: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 
<mailto: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 
<mailto: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 
<mailto: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 
<mailto: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 
<mailto:django-users+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP6hVmA0-TCTj%2B%3DqqseEq%2BKjaVtiCo7bbSiLmNKX9-AnSZiCqg%40mail.gmail.com
 
<https://groups.google.com/d/msgid/django-users/CAP6hVmA0-TCTj%2B%3DqqseEq%2BKjaVtiCo7bbSiLmNKX9-AnSZiCqg%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/001d01d62692%24af5ee1c0%240e1ca540%24%40gmail.com.

Reply via email to