13 views
Skip to first unread message

Umar Kambala

unread,
May 23, 2018, 5:57:06 AM5/23/18
to django...@googlegroups.com

Plz need help
I found this problem TemplateDoesNotExit at /polls/1/ where might have I gone wrong?

tango ward

unread,
May 23, 2018, 5:58:45 AM5/23/18
to django...@googlegroups.com
Check if your template name is correct in your views.py

On Wed, May 23, 2018 at 5:56 PM, Umar Kambala <umark...@gmail.com> wrote:

Plz need help
I found this problem TemplateDoesNotExit at /polls/1/ where might have I gone wrong?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPkbFbZwVPyBpVsA65UTjeJNgKHnQqpsTVmOmeO5GFeusnVfww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Umar Kambala

unread,
May 23, 2018, 6:16:33 AM5/23/18
to django...@googlegroups.com

Yes its spelled correctly on the command window its telling me
TemplateDoesNotExit: polls/detail.html

James Farris

unread,
May 23, 2018, 9:46:31 AM5/23/18
to django...@googlegroups.com
I assume you mean TemplateDoesNotExist and I also assume you have created a templates folder in your project and have details.html in it. 

If that’s the case did you check your settings.py for your template settings?

It should look something like this. 

TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates'), ], 'APP_DIRS': True,
...More code here...

On Wed, May 23, 2018 at 3:16 AM Umar Kambala <umark...@gmail.com> wrote:

Yes its spelled correctly on the command window its telling me
TemplateDoesNotExit: polls/detail.html

On May 23, 2018 9:58 AM, "tango ward" <tango...@gmail.com> wrote:
Check if your template name is correct in your views.py
On Wed, May 23, 2018 at 5:56 PM, Umar Kambala <umark...@gmail.com> wrote:

Plz need help
I found this problem TemplateDoesNotExit at /polls/1/ where might have I gone wrong?

--
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...@googlegroups.com.

--
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...@googlegroups.com.

--
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...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Anthony Flury

unread,
May 23, 2018, 4:54:35 PM5/23/18
to django...@googlegroups.com
Does the file actually exist - it should be in :

*my_site/polls/templates/polls/*

https://docs.djangoproject.com/en/2.0/intro/tutorial03/#write-views-that-actually-do-something

    Assuming you haven't changed the TEMPLATES settings in some way.

--
--
Anthony Flury
email : *Anthon...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

On 23/05/18 11:16, Umar Kambala wrote:
>
> Yes its spelled correctly on the command window its telling me
> TemplateDoesNotExit: polls/detail.html
>
> On May 23, 2018 9:58 AM, "tango ward" <tango...@gmail.com
> <mailto:tango...@gmail.com>> wrote:
>
> Check if your template name is correct in your views.py
>
> On Wed, May 23, 2018 at 5:56 PM, Umar Kambala
> <umark...@gmail.com <mailto:umark...@gmail.com>> wrote:
>
> Plz need help
> I found this problem TemplateDoesNotExit at /polls/1/ where
> might have I gone wrong?
>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to
> django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/group/django-users>.
> <https://groups.google.com/d/msgid/django-users/CAPkbFbZwVPyBpVsA65UTjeJNgKHnQqpsTVmOmeO5GFeusnVfww%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA6wQLLkxWQd3wDOMPNDEAPPNeTfVJhU7L1GP4au75yrU6Bcuw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA6wQLLkxWQd3wDOMPNDEAPPNeTfVJhU7L1GP4au75yrU6Bcuw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPkbFbZmHibrrij317hQeczBiWqFB_QexEZFxKcko2qpsbzEww%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPkbFbZmHibrrij317hQeczBiWqFB_QexEZFxKcko2qpsbzEww%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Umar Kambala

unread,
May 24, 2018, 5:46:48 AM5/24/18
to django...@googlegroups.com

Thanks for the help, I made the corrections n I still gets error
AttributeError: module 'polls.views' has no attribute 'index'.

On May 23, 2018 1:46 PM, "James Farris" <jamesa...@gmail.com> wrote:
I assume you mean TemplateDoesNotExist and I also assume you have created a templates folder in your project and have details.html in it. 

If that’s the case did you check your settings.py for your template settings?

It should look something like this. 

TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates'), ], 'APP_DIRS': True,
...More code here...

On Wed, May 23, 2018 at 3:16 AM Umar Kambala <umark...@gmail.com> wrote:

Yes its spelled correctly on the command window its telling me
TemplateDoesNotExit: polls/detail.html

On May 23, 2018 9:58 AM, "tango ward" <tango...@gmail.com> wrote:
Check if your template name is correct in your views.py
On Wed, May 23, 2018 at 5:56 PM, Umar Kambala <umark...@gmail.com> wrote:

Plz need help
I found this problem TemplateDoesNotExit at /polls/1/ where might have I gone wrong?

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Umar Kambala

unread,
May 24, 2018, 6:15:20 AM5/24/18
to django...@googlegroups.com

I change the template settings to this

TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates'), ], 'APP_DIRS': True,

...More code here...

On May 23, 2018 8:54 PM, "'Anthony Flury' via Django users" <django...@googlegroups.com> wrote:
Does the file actually exist - it should be in :

   *my_site/polls/templates/polls/*

https://docs.djangoproject.com/en/2.0/intro/tutorial03/#write-views-that-actually-do-something

    Assuming you haven't changed the TEMPLATES settings in some way.

--
--
Anthony Flury
email : *Anthon...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

On 23/05/18 11:16, Umar Kambala wrote:

Yes its spelled correctly on the command window its telling me
TemplateDoesNotExit: polls/detail.html

On May 23, 2018 9:58 AM, "tango ward" <tango...@gmail.com <mailto:tango...@gmail.com>> wrote:

    Check if your template name is correct in your views.py

    On Wed, May 23, 2018 at 5:56 PM, Umar Kambala
    <umark...@gmail.com <mailto:umark...@gmail.com>> wrote:

        Plz need help
        I found this problem TemplateDoesNotExit at /polls/1/ where
        might have I gone wrong?

        --         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+unsubscribe@googlegroups.com
        <mailto:django-users+unsubscrib...@googlegroups.com>.

        To post to this group, send email to
        django...@googlegroups.com
        <mailto:django-users@googlegroups.com>.

        Visit this group at
        https://groups.google.com/group/django-users
        <https://groups.google.com/group/django-users>.
        To view this discussion on the web visit
        https://groups.google.com/d/msgid/django-users/CAPkbFbZwVPyBpVsA65UTjeJNgKHnQqpsTVmOmeO5GFeusnVfww%40mail.gmail.com
        <https://groups.google.com/d/msgid/django-users/CAPkbFbZwVPyBpVsA65UTjeJNgKHnQqpsTVmOmeO5GFeusnVfww%40mail.gmail.com?utm_medium=email&utm_source=footer>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.


    --     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,

    To post to this group, send email to django...@googlegroups.com
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com <mailto:django-users+unsubscrib...@googlegroups.com>.
To post to this group, send email to django...@googlegroups.com <mailto:django-users@googlegroups.com>.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

Umar Kambala

unread,
May 24, 2018, 6:44:26 AM5/24/18
to django...@googlegroups.com

this my error


TemplateDoesNotExist at /polls/1/

polls/detail.html
Request Method:GET
Request URL:http://127.0.0.1:8000/polls/1/
Django Version:2.0.5
Exception Type:TemplateDoesNotExist
Exception Value:
polls/detail.html
Exception Location:C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loader.py in get_template, line 19
Python Executable:C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\python.exe
Python Version:3.6.5
Python Path:
['C:\\Users\\Admin\\Desktop\\Djan Polls\\mysite',
 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python36-32\\python36.zip',
 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python36-32\\DLLs',
 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python36-32\\lib',
 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python36-32',
 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages']
Server time:Thu, 24 May 2018 17:41:12 +0000

Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:

  • django.template.loaders.app_directories.Loader: C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\contrib\admin\templates\polls\detail.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\contrib\auth\templates\polls\detail.html (Source does not exist)

Reply all
Reply to author
Forward
0 new messages