TemplateDoesNotExist Error on deploying

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

TemplateDoesNotExist Error on deploying

yingi keme
I tried deploying my app to pythonanywhere hosting service and i am getting

TemplateDoesNotExist Error

Everything seems to work out well with my development server. But its not working fine when hosting

Anyhelp please!!

Here is my View

def Home(request):
    template = 'Home\First.html'
    return render(request, template)

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/5078f6e6-1c01-450d-8933-e8abb5632aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: TemplateDoesNotExist Error on deploying

Kasper Laudrup
Hi Yingi,

On 2018-01-13 14:46, yingi keme wrote:

> I tried deploying my app to pythonanywhere hosting service and i am getting
>
> TemplateDoesNotExist Error
>
> Everything seems to work out well with my development server. But its
> not working fine when hosting
>
> Anyhelp please!!
>
> Here is my View
>
> def Home(request):
>      template = 'Home\First.html'
>      return render(request, template)
>

Avoid using backslashes ('\') in paths. Use a normal slash ('/') instead.

Not sure if that solves your problem, but it's a good idea anyway.

Backslashes are used for escaping characters in Python (and most other
languages).

Also, if you post the entire error message (not just the exception type)
it would be much easier to help you.

Kind regards,

Kasper Laudrup

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/2d02cda2-6678-607a-87c0-d8a862a35ecd%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: TemplateDoesNotExist Error on deploying

yingi keme
Thanks Kasper. It was the backslash.

Thanks for saving me...

Yingi Kem

> On 13 Jan 2018, at 2:52 PM, Kasper Laudrup <[hidden email]> wrote:
>
> Hi Yingi,
>
>> On 2018-01-13 14:46, yingi keme wrote:
>> I tried deploying my app to pythonanywhere hosting service and i am getting
>> TemplateDoesNotExist Error
>> Everything seems to work out well with my development server. But its not working fine when hosting
>> Anyhelp please!!
>> Here is my View
>> def Home(request):
>>     template = 'Home\First.html'
>>     return render(request, template)
>
> Avoid using backslashes ('\') in paths. Use a normal slash ('/') instead.
>
> Not sure if that solves your problem, but it's a good idea anyway.
>
> Backslashes are used for escaping characters in Python (and most other languages).
>
> Also, if you post the entire error message (not just the exception type) it would be much easier to help you.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 [hidden email].
> To post to this group, send email to [hidden email].
> 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/2d02cda2-6678-607a-87c0-d8a862a35ecd%40stacktrace.dk.
> For more options, visit 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 [hidden email].
To post to this group, send email to [hidden email].
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/385DF731-B00F-4255-812C-27319239EF33%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: TemplateDoesNotExist Error on deploying

Jani Tiainen
Hi,

Also be careful with file names. For example windows is case-preserving but case-insensitive. You may accidentally name your templates with different  casing which may lead difficult to spot problems. 

13.1.2018 22.58 "yingi keme" <[hidden email]> kirjoitti:
Thanks Kasper. It was the backslash.

Thanks for saving me...

Yingi Kem

> On 13 Jan 2018, at 2:52 PM, Kasper Laudrup <[hidden email]> wrote:
>
> Hi Yingi,
>
>> On 2018-01-13 14:46, yingi keme wrote:
>> I tried deploying my app to pythonanywhere hosting service and i am getting
>> TemplateDoesNotExist Error
>> Everything seems to work out well with my development server. But its not working fine when hosting
>> Anyhelp please!!
>> Here is my View
>> def Home(request):
>>     template = 'Home\First.html'
>>     return render(request, template)
>
> Avoid using backslashes ('\') in paths. Use a normal slash ('/') instead.
>
> Not sure if that solves your problem, but it's a good idea anyway.
>
> Backslashes are used for escaping characters in Python (and most other languages).
>
> Also, if you post the entire error message (not just the exception type) it would be much easier to help you.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 [hidden email].
> To post to this group, send email to [hidden email].
> 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/2d02cda2-6678-607a-87c0-d8a862a35ecd%40stacktrace.dk.
> For more options, visit 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 [hidden email].
To post to this group, send email to [hidden email].
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/385DF731-B00F-4255-812C-27319239EF33%40gmail.com.
For more options, visit 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 [hidden email].
To post to this group, send email to [hidden email].
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/CAHn91oeFU1zweEcrQBR0-dE%2BuB8PYc_58LYHMMybu8ZVDDjBMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: TemplateDoesNotExist Error on deploying

yingi keme
Okk Jani. I will take note of that too..

Thanks

Yingi Kem

On 13 Jan 2018, at 10:28 PM, Jani Tiainen <[hidden email]> wrote:

Hi,

Also be careful with file names. For example windows is case-preserving but case-insensitive. You may accidentally name your templates with different  casing which may lead difficult to spot problems. 

13.1.2018 22.58 "yingi keme" <[hidden email]> kirjoitti:
Thanks Kasper. It was the backslash.

Thanks for saving me...

Yingi Kem

> On 13 Jan 2018, at 2:52 PM, Kasper Laudrup <[hidden email]> wrote:
>
> Hi Yingi,
>
>> On 2018-01-13 14:46, yingi keme wrote:
>> I tried deploying my app to pythonanywhere hosting service and i am getting
>> TemplateDoesNotExist Error
>> Everything seems to work out well with my development server. But its not working fine when hosting
>> Anyhelp please!!
>> Here is my View
>> def Home(request):
>>     template = 'Home\First.html'
>>     return render(request, template)
>
> Avoid using backslashes ('\') in paths. Use a normal slash ('/') instead.
>
> Not sure if that solves your problem, but it's a good idea anyway.
>
> Backslashes are used for escaping characters in Python (and most other languages).
>
> Also, if you post the entire error message (not just the exception type) it would be much easier to help you.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 [hidden email].
> To post to this group, send email to [hidden email].
> 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/2d02cda2-6678-607a-87c0-d8a862a35ecd%40stacktrace.dk.
> For more options, visit 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 [hidden email].
To post to this group, send email to [hidden email].
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/385DF731-B00F-4255-812C-27319239EF33%40gmail.com.
For more options, visit 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 [hidden email].
To post to this group, send email to [hidden email].
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/CAHn91oeFU1zweEcrQBR0-dE%2BuB8PYc_58LYHMMybu8ZVDDjBMw%40mail.gmail.com.
For more options, visit 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 [hidden email].
To post to this group, send email to [hidden email].
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/BD865F69-AC28-4E6A-A385-AC2F2A2418FD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.