Re: TemplateDoesNotExist at /

2022-06-05 Thread bnmng
What it the URL that is causing this error?

On Saturday, June 4, 2022 at 10:59:13 AM UTC-4 pm29...@gmail.com wrote:

> TemplateDoesNotExist at /home.html
> Request Method:
> GET
> Request URL:
> http://127.0.0.1:8000/
> Django Version:
> 4.0.3
> Exception Type:
> TemplateDoesNotExist
> Exception Value:
> home.html
> Exception Location:
> C:\Users\softy\AppData\Local\Programs\Python\Python310\lib\site-packages\django\template\loader.py,
>  
> line 47, in select_template
> Python Executable:
> C:\Users\softy\AppData\Local\Programs\Python\Python310\python.exe
> Python Version:
> 3.10.2
> Python Path:
> ['D:\\PYTHON COURSE RESOURCES\\BOOKS\\1 WEB DEVELOPMENT\\django ' 
> '1\\djangonautic\\djangonautic\\booktime\\booktime', 
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip',
>  
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\DLLs', 
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib', 
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310', 
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages',
>  
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\win32',
>  
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\win32\\lib',
>  
> 'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\Pythonwin']
> Server time:
> Sat, 04 Jun 2022 08:16:02 +
> Template-loader postmortem
>
> Django tried loading these templates, in this order:
>
> Using engine django:
>
>- django.template.loaders.app_directories.Loader: 
>
> C:\Users\softy\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\admin\templates\home.html
>  
>(Source does not exist)
>- django.template.loaders.app_directories.Loader: 
>
> C:\Users\softy\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\auth\templates\home.html
>  
>(Source does not exist)
>
>

-- 
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/204e76f9-1c4f-49a1-945e-368f76e7885dn%40googlegroups.com.


TemplateDoesNotExist at /

2022-06-04 Thread peter softy
TemplateDoesNotExist at /home.html
Request Method:
GET
Request URL:
http://127.0.0.1:8000/
Django Version:
4.0.3
Exception Type:
TemplateDoesNotExist
Exception Value:
home.html
Exception Location:
C:\Users\softy\AppData\Local\Programs\Python\Python310\lib\site-packages\django\template\loader.py,
 
line 47, in select_template
Python Executable:
C:\Users\softy\AppData\Local\Programs\Python\Python310\python.exe
Python Version:
3.10.2
Python Path:
['D:\\PYTHON COURSE RESOURCES\\BOOKS\\1 WEB DEVELOPMENT\\django ' 
'1\\djangonautic\\djangonautic\\booktime\\booktime', 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip', 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\DLLs', 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib', 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310', 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages',
 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\win32',
 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\win32\\lib',
 
'C:\\Users\\softy\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\Pythonwin']
Server time:
Sat, 04 Jun 2022 08:16:02 +
Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:

   - django.template.loaders.app_directories.Loader: 
   
C:\Users\softy\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\admin\templates\home.html
 
   (Source does not exist)
   - django.template.loaders.app_directories.Loader: 
   
C:\Users\softy\AppData\Local\Programs\Python\Python310\lib\site-packages\django\contrib\auth\templates\home.html
 
   (Source does not exist)

-- 
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/6166dfa9-1db8-48eb-9192-7664756f6d15n%40googlegroups.com.


Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Никита Назаров
Thank you so much!

ср, 6 окт. 2021 г. в 19:41, Adeyemi Deji :

> Hi, please make reference to link below, looks similar to what you are
> building
>
> https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Generic_views
>
> Also I will read up the documentation to find solution to this issue. You
> can take a break, you have really worked hard today.
>
> On Wednesday, October 6, 2021 at 5:26:19 PM UTC+2 nazni...@gmail.com
> wrote:
>
>> No, both variants don't work.
>>
>> ср, 6 окт. 2021 г. в 18:17, Adeyemi Deji :
>>
>>> Okay, I also noticed something in the TEMPLATES VARIABLE in your
>>> settings.py file, please make DIRS an empty list like this [] with no space
>>> or better still change to [os.path.join(BASE_DIR, 'catalog/templates')]
>>>
>>> On Wednesday, October 6, 2021 at 5:00:42 PM UTC+2 nazni...@gmail.com
>>> wrote:
>>>
>>>> Thank you!
>>>> I corrected as you wrote. But I also have this mistake (
>>>> TemplateDoesNotExist at /catalog/books/
>>>> catalog/book_list.html, catalog/book_list.html).
>>>> Might I take the wrong path? (my path is below picture)
>>>> Also thank you for helping me. I am grateful to you. I have had this
>>>> problem for 1 week.
>>>> [image: image.png]
>>>>
>>>>
>>>> ср, 6 окт. 2021 г. в 16:19, Adeyemi Deji :
>>>>
>>>>> correct paginated_by to paginate_by.
>>>>>
>>>>>
>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>>>  Virus-free.
>>>>> www.avast.com
>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>>> <#m_5814264379585491325_m_-1143733024743841618_m_-1887519385446215222_m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>>
>>>>> On Wed, Oct 6, 2021 at 3:17 PM Adeyemi Deji 
>>>>> wrote:
>>>>>
>>>>>> Please correct your class views, you are getting it wrong.
>>>>>> it should look like this.
>>>>>>
>>>>>> class BookListView(generic.ListView):
>>>>>> model = Book
>>>>>> paginated_by = 10
>>>>>> template_name = "catalog/book_list.html"
>>>>>>
>>>>>> class BookDetailView(generic.DetailView):
>>>>>> model = Book
>>>>>>     template_name = "catalog/book_detail.html"
>>>>>>
>>>>>>
>>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>>>>  Virus-free.
>>>>>> www.avast.com
>>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>>>> <#m_5814264379585491325_m_-1143733024743841618_m_-1887519385446215222_m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_m_1024950781820118978_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>>>
>>>>>> On Wed, Oct 6, 2021 at 3:09 PM Никита Назаров 
>>>>>> wrote:
>>>>>>
>>>>>>> It also doesn't work. I see this error :"TemplateDoesNotExist at
>>>>>>> /catalog/books/ catalog/book_list.html, catalog/book_list.html"
>>>>>>> My views.py is below.
>>>>>>> Also, I checked on GitHub Mozilla (
>>>>>>> https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
>>>>>>> They didn't use - template_name.
>>>>>>> I'm completely confused.
>>>>>>>
>>>>>>> from .models import Book, Author, BookInstance, Genre
>>>>>>> from django.views import generic
>>>>>>> from django.shortcuts import render
>>>>>>> from django.views.generic.base import TemplateView
>>>>>>>
>>>>>>> # Create your views here.
>>>>>>>
>>>>>>>
>>>>>>> def index(request):
>>>>>>> """View function for home page of site."""
>>>>>>>
>>>>>>> # Generate counts of some of the main objects

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
Hi, please make reference to link below, looks similar to what you are 
building
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Generic_views

Also I will read up the documentation to find solution to this issue. You 
can take a break, you have really worked hard today. 

On Wednesday, October 6, 2021 at 5:26:19 PM UTC+2 nazni...@gmail.com wrote:

> No, both variants don't work. 
>
> ср, 6 окт. 2021 г. в 18:17, Adeyemi Deji :
>
>> Okay, I also noticed something in the TEMPLATES VARIABLE in your 
>> settings.py file, please make DIRS an empty list like this [] with no space 
>> or better still change to [os.path.join(BASE_DIR, 'catalog/templates')]
>>
>> On Wednesday, October 6, 2021 at 5:00:42 PM UTC+2 nazni...@gmail.com 
>> wrote:
>>
>>> Thank you!
>>> I corrected as you wrote. But I also have this mistake (
>>> TemplateDoesNotExist at /catalog/books/
>>> catalog/book_list.html, catalog/book_list.html). 
>>> Might I take the wrong path? (my path is below picture)
>>> Also thank you for helping me. I am grateful to you. I have had this 
>>> problem for 1 week. 
>>> [image: image.png]
>>>
>>>
>>> ср, 6 окт. 2021 г. в 16:19, Adeyemi Deji :
>>>
>>>> correct paginated_by to paginate_by.
>>>>
>>>>
>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>>  Virus-free. 
>>>> www.avast.com 
>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>>  
>>>> <#m_-1143733024743841618_m_-1887519385446215222_m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>
>>>> On Wed, Oct 6, 2021 at 3:17 PM Adeyemi Deji  
>>>> wrote:
>>>>
>>>>> Please correct your class views, you are getting it wrong.
>>>>> it should look like this.
>>>>>
>>>>> class BookListView(generic.ListView):
>>>>> model = Book
>>>>> paginated_by = 10
>>>>> template_name = "catalog/book_list.html"
>>>>>
>>>>> class BookDetailView(generic.DetailView):
>>>>> model = Book
>>>>> template_name = "catalog/book_detail.html"
>>>>>
>>>>>
>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>>>  Virus-free. 
>>>>> www.avast.com 
>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>>>  
>>>>> <#m_-1143733024743841618_m_-1887519385446215222_m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_m_1024950781820118978_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>>
>>>>> On Wed, Oct 6, 2021 at 3:09 PM Никита Назаров  
>>>>> wrote:
>>>>>
>>>>>> It also doesn't work. I see this error :"TemplateDoesNotExist at 
>>>>>> /catalog/books/ catalog/book_list.html, catalog/book_list.html"
>>>>>> My views.py is below.
>>>>>> Also, I checked on GitHub Mozilla (
>>>>>> https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
>>>>>>  
>>>>>> They didn't use - template_name. 
>>>>>> I'm completely confused. 
>>>>>>
>>>>>> from .models import Book, Author, BookInstance, Genre
>>>>>> from django.views import generic
>>>>>> from django.shortcuts import render
>>>>>> from django.views.generic.base import TemplateView
>>>>>>
>>>>>> # Create your views here.
>>>>>>
>>>>>>
>>>>>> def index(request):
>>>>>> """View function for home page of site."""
>>>>>>
>>>>>> # Generate counts of some of the main objects
>>>>>> num_books = Book.objects.all().count()
>>>>>> num_instances = BookInstance.objects.all().count()
>>>>>>
>>>>>> # Available books (status = 'a')
>>>>>> num_instances_available = BookInstance.objects.filter(
>>>>>> status__exact='a').count()
>>>>>>

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Никита Назаров
No, both variants don't work.

ср, 6 окт. 2021 г. в 18:17, Adeyemi Deji :

> Okay, I also noticed something in the TEMPLATES VARIABLE in your
> settings.py file, please make DIRS an empty list like this [] with no space
> or better still change to [os.path.join(BASE_DIR, 'catalog/templates')]
>
> On Wednesday, October 6, 2021 at 5:00:42 PM UTC+2 nazni...@gmail.com
> wrote:
>
>> Thank you!
>> I corrected as you wrote. But I also have this mistake (
>> TemplateDoesNotExist at /catalog/books/
>> catalog/book_list.html, catalog/book_list.html).
>> Might I take the wrong path? (my path is below picture)
>> Also thank you for helping me. I am grateful to you. I have had this
>> problem for 1 week.
>> [image: image.png]
>>
>>
>> ср, 6 окт. 2021 г. в 16:19, Adeyemi Deji :
>>
>>> correct paginated_by to paginate_by.
>>>
>>>
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>  Virus-free.
>>> www.avast.com
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>> <#m_-1887519385446215222_m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>> On Wed, Oct 6, 2021 at 3:17 PM Adeyemi Deji  wrote:
>>>
>>>> Please correct your class views, you are getting it wrong.
>>>> it should look like this.
>>>>
>>>> class BookListView(generic.ListView):
>>>> model = Book
>>>> paginated_by = 10
>>>> template_name = "catalog/book_list.html"
>>>>
>>>> class BookDetailView(generic.DetailView):
>>>> model = Book
>>>> template_name = "catalog/book_detail.html"
>>>>
>>>>
>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>>  Virus-free.
>>>> www.avast.com
>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>> <#m_-1887519385446215222_m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_m_1024950781820118978_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>
>>>> On Wed, Oct 6, 2021 at 3:09 PM Никита Назаров 
>>>> wrote:
>>>>
>>>>> It also doesn't work. I see this error :"TemplateDoesNotExist at
>>>>> /catalog/books/ catalog/book_list.html, catalog/book_list.html"
>>>>> My views.py is below.
>>>>> Also, I checked on GitHub Mozilla (
>>>>> https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
>>>>> They didn't use - template_name.
>>>>> I'm completely confused.
>>>>>
>>>>> from .models import Book, Author, BookInstance, Genre
>>>>> from django.views import generic
>>>>> from django.shortcuts import render
>>>>> from django.views.generic.base import TemplateView
>>>>>
>>>>> # Create your views here.
>>>>>
>>>>>
>>>>> def index(request):
>>>>> """View function for home page of site."""
>>>>>
>>>>> # Generate counts of some of the main objects
>>>>> num_books = Book.objects.all().count()
>>>>> num_instances = BookInstance.objects.all().count()
>>>>>
>>>>> # Available books (status = 'a')
>>>>> num_instances_available = BookInstance.objects.filter(
>>>>> status__exact='a').count()
>>>>>
>>>>> # The 'all()' is implied by default.
>>>>> num_authors = Author.objects.count()
>>>>>
>>>>> context = {
>>>>> 'num_books': num_books,
>>>>> 'num_instances': num_instances,
>>>>> 'num_instances_available': num_instances_available,
>>>>> 'num_authors': num_authors,
>>>>> }
>>>>>
>>>>> # Render the HTML template index.html with the data in the context
>>>>> variable
>>>>> return render(request, 'index.html', context=context)
>>>>>
>>>>>
>>>>> class BookListView(generic.ListView):
>>>>>
>>>>> """Generic class-based view for a list of books."""

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
Okay, I also noticed something in the TEMPLATES VARIABLE in your 
settings.py file, please make DIRS an empty list like this [] with no space 
or better still change to [os.path.join(BASE_DIR, 'catalog/templates')]

On Wednesday, October 6, 2021 at 5:00:42 PM UTC+2 nazni...@gmail.com wrote:

> Thank you!
> I corrected as you wrote. But I also have this mistake (
> TemplateDoesNotExist at /catalog/books/
> catalog/book_list.html, catalog/book_list.html). 
> Might I take the wrong path? (my path is below picture)
> Also thank you for helping me. I am grateful to you. I have had this 
> problem for 1 week. 
> [image: image.png]
>
>
> ср, 6 окт. 2021 г. в 16:19, Adeyemi Deji :
>
>> correct paginated_by to paginate_by.
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>  Virus-free. 
>> www.avast.com 
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>  
>> <#m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> On Wed, Oct 6, 2021 at 3:17 PM Adeyemi Deji  wrote:
>>
>>> Please correct your class views, you are getting it wrong.
>>> it should look like this.
>>>
>>> class BookListView(generic.ListView):
>>> model = Book
>>> paginated_by = 10
>>> template_name = "catalog/book_list.html"
>>>
>>> class BookDetailView(generic.DetailView):
>>> model = Book
>>> template_name = "catalog/book_detail.html"
>>>
>>>
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>  Virus-free. 
>>> www.avast.com 
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>  
>>> <#m_-4865023885270008228_m_2700252164806904525_m_-6914425398611891894_m_1024950781820118978_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>> On Wed, Oct 6, 2021 at 3:09 PM Никита Назаров  
>>> wrote:
>>>
>>>> It also doesn't work. I see this error :"TemplateDoesNotExist at 
>>>> /catalog/books/ catalog/book_list.html, catalog/book_list.html"
>>>> My views.py is below.
>>>> Also, I checked on GitHub Mozilla (
>>>> https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
>>>>  
>>>> They didn't use - template_name. 
>>>> I'm completely confused. 
>>>>
>>>> from .models import Book, Author, BookInstance, Genre
>>>> from django.views import generic
>>>> from django.shortcuts import render
>>>> from django.views.generic.base import TemplateView
>>>>
>>>> # Create your views here.
>>>>
>>>>
>>>> def index(request):
>>>> """View function for home page of site."""
>>>>
>>>> # Generate counts of some of the main objects
>>>> num_books = Book.objects.all().count()
>>>> num_instances = BookInstance.objects.all().count()
>>>>
>>>> # Available books (status = 'a')
>>>> num_instances_available = BookInstance.objects.filter(
>>>> status__exact='a').count()
>>>>
>>>> # The 'all()' is implied by default.
>>>> num_authors = Author.objects.count()
>>>>
>>>> context = {
>>>> 'num_books': num_books,
>>>> 'num_instances': num_instances,
>>>> 'num_instances_available': num_instances_available,
>>>> 'num_authors': num_authors,
>>>> }
>>>>
>>>> # Render the HTML template index.html with the data in the context 
>>>> variable
>>>> return render(request, 'index.html', context=context)
>>>>
>>>>
>>>> class BookListView(generic.ListView):
>>>>
>>>> """Generic class-based view for a list of books."""
>>>>
>>>> model = Book
>>>> paginate_by = 10
>>>> template_name = "catalog/book_list.html"
>>>>
>>>>
>>>> class BookDetailView(generic.DetailView):
>>>>
>>>> """Generic class-based detail view for a book."""
>>>> model = Book
>>>> template_name = "catalog/book_detail.html"

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
correct paginated_by to paginate_by.

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Oct 6, 2021 at 3:17 PM Adeyemi Deji  wrote:

> Please correct your class views, you are getting it wrong.
> it should look like this.
>
> class BookListView(generic.ListView):
> model = Book
> paginated_by = 10
> template_name = "catalog/book_list.html"
>
> class BookDetailView(generic.DetailView):
> model = Book
> template_name = "catalog/book_detail.html"
>
>
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>  Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
> <#m_1024950781820118978_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Wed, Oct 6, 2021 at 3:09 PM Никита Назаров 
> wrote:
>
>> It also doesn't work. I see this error :"TemplateDoesNotExist at
>> /catalog/books/ catalog/book_list.html, catalog/book_list.html"
>> My views.py is below.
>> Also, I checked on GitHub Mozilla (
>> https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
>> They didn't use - template_name.
>> I'm completely confused.
>>
>> from .models import Book, Author, BookInstance, Genre
>> from django.views import generic
>> from django.shortcuts import render
>> from django.views.generic.base import TemplateView
>>
>> # Create your views here.
>>
>>
>> def index(request):
>> """View function for home page of site."""
>>
>> # Generate counts of some of the main objects
>> num_books = Book.objects.all().count()
>> num_instances = BookInstance.objects.all().count()
>>
>> # Available books (status = 'a')
>> num_instances_available = BookInstance.objects.filter(
>> status__exact='a').count()
>>
>> # The 'all()' is implied by default.
>> num_authors = Author.objects.count()
>>
>> context = {
>> 'num_books': num_books,
>> 'num_instances': num_instances,
>> 'num_instances_available': num_instances_available,
>> 'num_authors': num_authors,
>> }
>>
>> # Render the HTML template index.html with the data in the context
>> variable
>> return render(request, 'index.html', context=context)
>>
>>
>> class BookListView(generic.ListView):
>>
>> """Generic class-based view for a list of books."""
>>
>> model = Book
>> paginate_by = 10
>> template_name = "catalog/book_list.html"
>>
>>
>> class BookDetailView(generic.DetailView):
>>
>> """Generic class-based detail view for a book."""
>> model = Book
>> template_name = "catalog/book_detail.html"
>>
>>
>>
>> ср, 6 окт. 2021 г. в 14:24, Adeyemi Deji :
>>
>>> class BookListView(generic.ListView):
>>>
>>> """Generic class-based view for a list of books."""
>>>
>>> model = Book
>>>
>>> paginate_by = 10
>>>
>>> template_name = "catalog/book_list.html"
>>>
>>>
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>  Virus-free.
>>> www.avast.com
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>> <#m_1024950781820118978_m_8455319138707163929_m_3791702616293114032_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>> On Wed, Oct 6, 2021 at 1:21 PM Adeyemi Deji 
>>> wrote:
>>>
>>>> Please don't change your formal code setting, just add the
>>>> template_name attribute and specify the template you are referring to
>>>> just add this to your former code:
>>>> template_name = "catalog/book_list.html"
>>>>
>>>>
>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>>  Virus-free.
>>>> www.avast.com
>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>>

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
Please correct your class views, you are getting it wrong.
it should look like this.

class BookListView(generic.ListView):
model = Book
paginated_by = 10
template_name = "catalog/book_list.html"

class BookDetailView(generic.DetailView):
model = Book
template_name = "catalog/book_detail.html"

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Oct 6, 2021 at 3:09 PM Никита Назаров  wrote:

> It also doesn't work. I see this error :"TemplateDoesNotExist at
> /catalog/books/ catalog/book_list.html, catalog/book_list.html"
> My views.py is below.
> Also, I checked on GitHub Mozilla (
> https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
> They didn't use - template_name.
> I'm completely confused.
>
> from .models import Book, Author, BookInstance, Genre
> from django.views import generic
> from django.shortcuts import render
> from django.views.generic.base import TemplateView
>
> # Create your views here.
>
>
> def index(request):
> """View function for home page of site."""
>
> # Generate counts of some of the main objects
> num_books = Book.objects.all().count()
> num_instances = BookInstance.objects.all().count()
>
> # Available books (status = 'a')
> num_instances_available = BookInstance.objects.filter(
> status__exact='a').count()
>
> # The 'all()' is implied by default.
> num_authors = Author.objects.count()
>
> context = {
> 'num_books': num_books,
> 'num_instances': num_instances,
> 'num_instances_available': num_instances_available,
> 'num_authors': num_authors,
> }
>
> # Render the HTML template index.html with the data in the context variable
> return render(request, 'index.html', context=context)
>
>
> class BookListView(generic.ListView):
>
> """Generic class-based view for a list of books."""
>
> model = Book
> paginate_by = 10
> template_name = "catalog/book_list.html"
>
>
> class BookDetailView(generic.DetailView):
>
> """Generic class-based detail view for a book."""
> model = Book
> template_name = "catalog/book_detail.html"
>
>
>
> ср, 6 окт. 2021 г. в 14:24, Adeyemi Deji :
>
>> class BookListView(generic.ListView):
>>
>> """Generic class-based view for a list of books."""
>>
>> model = Book
>>
>> paginate_by = 10
>>
>> template_name = "catalog/book_list.html"
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>  Virus-free.
>> www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>> <#m_8455319138707163929_m_3791702616293114032_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> On Wed, Oct 6, 2021 at 1:21 PM Adeyemi Deji 
>> wrote:
>>
>>> Please don't change your formal code setting, just add the template_name
>>> attribute and specify the template you are referring to
>>> just add this to your former code:
>>> template_name = "catalog/book_list.html"
>>>
>>>
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>>  Virus-free.
>>> www.avast.com
>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>>> <#m_8455319138707163929_m_3791702616293114032_m_2104138296797754165_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>> On Wed, Oct 6, 2021 at 1:09 PM Никита Назаров 
>>> wrote:
>>>
>>>> It doesn't seem to work. I wrote your example in views.py.
>>>> Or I might make mistakes. Could you see?
>>>>
>>>> views. py
>>>> from .models import Book, Author, BookInstance, Genre
>>>> from django.views import generic
>>>> from django.shortcuts import render
>>>> from django.views.generic.base import TemplateView
>>>>
>>>> # Create your views here.
>>>>
>>>>
>>>> def index(request):
>>>> """View function for home page of site."""
>>>>
>>>> # Ge

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Никита Назаров
It also doesn't work. I see this error :"TemplateDoesNotExist at
/catalog/books/ catalog/book_list.html, catalog/book_list.html"
My views.py is below.
Also, I checked on GitHub Mozilla (
https://github.com/mdn/django-locallibrary-tutorial/blob/master/catalog/views.py).
They didn't use - template_name.
I'm completely confused.

from .models import Book, Author, BookInstance, Genre
from django.views import generic
from django.shortcuts import render
from django.views.generic.base import TemplateView

# Create your views here.


def index(request):
"""View function for home page of site."""

# Generate counts of some of the main objects
num_books = Book.objects.all().count()
num_instances = BookInstance.objects.all().count()

# Available books (status = 'a')
num_instances_available = BookInstance.objects.filter(
status__exact='a').count()

# The 'all()' is implied by default.
num_authors = Author.objects.count()

context = {
'num_books': num_books,
'num_instances': num_instances,
'num_instances_available': num_instances_available,
'num_authors': num_authors,
}

# Render the HTML template index.html with the data in the context variable
return render(request, 'index.html', context=context)


class BookListView(generic.ListView):

"""Generic class-based view for a list of books."""

model = Book
paginate_by = 10
template_name = "catalog/book_list.html"


class BookDetailView(generic.DetailView):

"""Generic class-based detail view for a book."""
model = Book
template_name = "catalog/book_detail.html"



ср, 6 окт. 2021 г. в 14:24, Adeyemi Deji :

> class BookListView(generic.ListView):
>
> """Generic class-based view for a list of books."""
>
> model = Book
>
> paginate_by = 10
>
> template_name = "catalog/book_list.html"
>
>
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>  Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
> <#m_3791702616293114032_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Wed, Oct 6, 2021 at 1:21 PM Adeyemi Deji 
> wrote:
>
>> Please don't change your formal code setting, just add the template_name
>> attribute and specify the template you are referring to
>> just add this to your former code:
>> template_name = "catalog/book_list.html"
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>>  Virus-free.
>> www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
>> <#m_3791702616293114032_m_2104138296797754165_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> On Wed, Oct 6, 2021 at 1:09 PM Никита Назаров 
>> wrote:
>>
>>> It doesn't seem to work. I wrote your example in views.py.
>>> Or I might make mistakes. Could you see?
>>>
>>> views. py
>>> from .models import Book, Author, BookInstance, Genre
>>> from django.views import generic
>>> from django.shortcuts import render
>>> from django.views.generic.base import TemplateView
>>>
>>> # Create your views here.
>>>
>>>
>>> def index(request):
>>> """View function for home page of site."""
>>>
>>> # Generate counts of some of the main objects
>>> num_books = Book.objects.all().count()
>>> num_instances = BookInstance.objects.all().count()
>>>
>>> # Available books (status = 'a')
>>> num_instances_available = BookInstance.objects.filter(
>>> status__exact='a').count()
>>>
>>> # The 'all()' is implied by default.
>>> num_authors = Author.objects.count()
>>>
>>> context = {
>>> 'num_books': num_books,
>>> 'num_instances': num_instances,
>>> 'num_instances_available': num_instances_available,
>>> 'num_authors': num_authors,
>>> }
>>>
>>> # Render the HTML template index.html with the data in the context
>>> variable
>>> return render(request, 'catalog/index.html', context=context)
>>>
>>>
>>> class BookListView(TemplateView):
>>> template_name = "catalog/book_list.html"
>>>
>>>
>>> class BookDetailView(TemplateView):
>>> template_name = "catalog/book_detail.html"
>>>
>>>
>>> urls.py
>>> from django.urls import path
>>> fro

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
class BookListView(generic.ListView):

"""Generic class-based view for a list of books."""

model = Book

paginate_by = 10

template_name = "catalog/book_list.html"

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Oct 6, 2021 at 1:21 PM Adeyemi Deji  wrote:

> Please don't change your formal code setting, just add the template_name
> attribute and specify the template you are referring to
> just add this to your former code:
> template_name = "catalog/book_list.html"
>
>
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
>  Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
> <#m_2104138296797754165_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Wed, Oct 6, 2021 at 1:09 PM Никита Назаров 
> wrote:
>
>> It doesn't seem to work. I wrote your example in views.py.
>> Or I might make mistakes. Could you see?
>>
>> views. py
>> from .models import Book, Author, BookInstance, Genre
>> from django.views import generic
>> from django.shortcuts import render
>> from django.views.generic.base import TemplateView
>>
>> # Create your views here.
>>
>>
>> def index(request):
>> """View function for home page of site."""
>>
>> # Generate counts of some of the main objects
>> num_books = Book.objects.all().count()
>> num_instances = BookInstance.objects.all().count()
>>
>> # Available books (status = 'a')
>> num_instances_available = BookInstance.objects.filter(
>> status__exact='a').count()
>>
>> # The 'all()' is implied by default.
>> num_authors = Author.objects.count()
>>
>> context = {
>> 'num_books': num_books,
>> 'num_instances': num_instances,
>> 'num_instances_available': num_instances_available,
>> 'num_authors': num_authors,
>> }
>>
>> # Render the HTML template index.html with the data in the context
>> variable
>> return render(request, 'catalog/index.html', context=context)
>>
>>
>> class BookListView(TemplateView):
>> template_name = "catalog/book_list.html"
>>
>>
>> class BookDetailView(TemplateView):
>> template_name = "catalog/book_detail.html"
>>
>>
>> urls.py
>> from django.urls import path
>> from . import views
>>
>>
>> urlpatterns = [
>> path('', views.index, name='index'),
>> path('books/', views.BookListView.as_view(), name='books'),
>> path('book/', views.BookDetailView.as_view(), name='book-detail'
>> ),
>> ]
>>
>>
>>
>>
>> ср, 6 окт. 2021 г. в 12:45, Adeyemi Deji :
>>
>>> for example.
>>>
>>> class AboutView(TemplateView):
>>> template_name = "about.html"
>>>
>>>
>>> On Wed, Oct 6, 2021 at 11:32 AM Никита Назаров 
>>> wrote:
>>>
>>>> Hello!
>>>> Thank you!
>>>> I'm sorry. How could I do this?
>>>>
>>>> среда, 6 октября 2021 г. в 11:20:19 UTC+3, adeyem...@gmail.com:
>>>>
>>>>> Hi, I observed that you didn't specify the template name attribute for
>>>>> the BookListView and BookDetailView, that should solve you problem.
>>>>>
>>>>> On Tuesday, October 5, 2021 at 10:37:19 PM UTC+2 nazni...@gmail.com
>>>>> wrote:
>>>>>
>>>>>> Hello!
>>>>>> I’m beginner in Django. I do Django Tutorial from Mozilla.
>>>>>> I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I
>>>>>> don’t understand how to resolve it.
>>>>>>
>>>>>> */catalog/urls*
>>>>>>
>>>>>> from django.urls import path
>>>>>>
>>>>>> from . import views
>>>>>>
>>>>>> urlpatterns = [
>>>>>>
>>>>>> path('', views.index, name='index'),
>>>>>>
>>>>>> path('books/', views.BookListView.as_view(), name='books'),
>>>>>>
>>>>>> path('book/', views.BookDetailView.as_view(),
>>>>&

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
Please don't change your formal code setting, just add the template_name
attribute and specify the template you are referring to
just add this to your former code:
template_name = "catalog/book_list.html"

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Oct 6, 2021 at 1:09 PM Никита Назаров  wrote:

> It doesn't seem to work. I wrote your example in views.py.
> Or I might make mistakes. Could you see?
>
> views. py
> from .models import Book, Author, BookInstance, Genre
> from django.views import generic
> from django.shortcuts import render
> from django.views.generic.base import TemplateView
>
> # Create your views here.
>
>
> def index(request):
> """View function for home page of site."""
>
> # Generate counts of some of the main objects
> num_books = Book.objects.all().count()
> num_instances = BookInstance.objects.all().count()
>
> # Available books (status = 'a')
> num_instances_available = BookInstance.objects.filter(
> status__exact='a').count()
>
> # The 'all()' is implied by default.
> num_authors = Author.objects.count()
>
> context = {
> 'num_books': num_books,
> 'num_instances': num_instances,
> 'num_instances_available': num_instances_available,
> 'num_authors': num_authors,
> }
>
> # Render the HTML template index.html with the data in the context variable
> return render(request, 'catalog/index.html', context=context)
>
>
> class BookListView(TemplateView):
> template_name = "catalog/book_list.html"
>
>
> class BookDetailView(TemplateView):
> template_name = "catalog/book_detail.html"
>
>
> urls.py
> from django.urls import path
> from . import views
>
>
> urlpatterns = [
> path('', views.index, name='index'),
> path('books/', views.BookListView.as_view(), name='books'),
> path('book/', views.BookDetailView.as_view(), name='book-detail'),
> ]
>
>
>
>
> ср, 6 окт. 2021 г. в 12:45, Adeyemi Deji :
>
>> for example.
>>
>> class AboutView(TemplateView):
>> template_name = "about.html"
>>
>>
>> On Wed, Oct 6, 2021 at 11:32 AM Никита Назаров 
>> wrote:
>>
>>> Hello!
>>> Thank you!
>>> I'm sorry. How could I do this?
>>>
>>> среда, 6 октября 2021 г. в 11:20:19 UTC+3, adeyem...@gmail.com:
>>>
>>>> Hi, I observed that you didn't specify the template name attribute for
>>>> the BookListView and BookDetailView, that should solve you problem.
>>>>
>>>> On Tuesday, October 5, 2021 at 10:37:19 PM UTC+2 nazni...@gmail.com
>>>> wrote:
>>>>
>>>>> Hello!
>>>>> I’m beginner in Django. I do Django Tutorial from Mozilla.
>>>>> I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I
>>>>> don’t understand how to resolve it.
>>>>>
>>>>> */catalog/urls*
>>>>>
>>>>> from django.urls import path
>>>>>
>>>>> from . import views
>>>>>
>>>>> urlpatterns = [
>>>>>
>>>>> path('', views.index, name='index'),
>>>>>
>>>>> path('books/', views.BookListView.as_view(), name='books'),
>>>>>
>>>>> path('book/', views.BookDetailView.as_view(),
>>>>> name='book-detail'),
>>>>>
>>>>> ]
>>>>>
>>>>> *catalog/models*
>>>>>
>>>>> # Used to generate URLs by reversing the URL patterns
>>>>>
>>>>> from django.urls import reverse
>>>>>
>>>>> from django.db import models
>>>>>
>>>>> from django.urls import reverse
>>>>>
>>>>> import uuid
>>>>>
>>>>> # Create your models here
>>>>>
>>>>> class Genre(models.Model):
>>>>>
>>>>> """Model representing a book genre (e.g. Science Fiction, Non
>>>>> Fiction)."""
>>>>>
>>>>> name = models.CharField(
>>>>>
>>>>> max_length=200,
>>>>>
>>>>> help_text="Enter a book genre (e.g. Science Fiction, French
>>>>> Poetry etc.)"
>>>>&

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Никита Назаров
It doesn't seem to work. I wrote your example in views.py.
Or I might make mistakes. Could you see?

views. py
from .models import Book, Author, BookInstance, Genre
from django.views import generic
from django.shortcuts import render
from django.views.generic.base import TemplateView

# Create your views here.


def index(request):
"""View function for home page of site."""

# Generate counts of some of the main objects
num_books = Book.objects.all().count()
num_instances = BookInstance.objects.all().count()

# Available books (status = 'a')
num_instances_available = BookInstance.objects.filter(
status__exact='a').count()

# The 'all()' is implied by default.
num_authors = Author.objects.count()

context = {
'num_books': num_books,
'num_instances': num_instances,
'num_instances_available': num_instances_available,
'num_authors': num_authors,
}

# Render the HTML template index.html with the data in the context variable
return render(request, 'catalog/index.html', context=context)


class BookListView(TemplateView):
template_name = "catalog/book_list.html"


class BookDetailView(TemplateView):
template_name = "catalog/book_detail.html"


urls.py
from django.urls import path
from . import views


urlpatterns = [
path('', views.index, name='index'),
path('books/', views.BookListView.as_view(), name='books'),
path('book/', views.BookDetailView.as_view(), name='book-detail'),
]




ср, 6 окт. 2021 г. в 12:45, Adeyemi Deji :

> for example.
>
> class AboutView(TemplateView):
> template_name = "about.html"
>
>
> On Wed, Oct 6, 2021 at 11:32 AM Никита Назаров 
> wrote:
>
>> Hello!
>> Thank you!
>> I'm sorry. How could I do this?
>>
>> среда, 6 октября 2021 г. в 11:20:19 UTC+3, adeyem...@gmail.com:
>>
>>> Hi, I observed that you didn't specify the template name attribute for
>>> the BookListView and BookDetailView, that should solve you problem.
>>>
>>> On Tuesday, October 5, 2021 at 10:37:19 PM UTC+2 nazni...@gmail.com
>>> wrote:
>>>
>>>> Hello!
>>>> I’m beginner in Django. I do Django Tutorial from Mozilla.
>>>> I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I
>>>> don’t understand how to resolve it.
>>>>
>>>> */catalog/urls*
>>>>
>>>> from django.urls import path
>>>>
>>>> from . import views
>>>>
>>>> urlpatterns = [
>>>>
>>>> path('', views.index, name='index'),
>>>>
>>>> path('books/', views.BookListView.as_view(), name='books'),
>>>>
>>>> path('book/', views.BookDetailView.as_view(),
>>>> name='book-detail'),
>>>>
>>>> ]
>>>>
>>>> *catalog/models*
>>>>
>>>> # Used to generate URLs by reversing the URL patterns
>>>>
>>>> from django.urls import reverse
>>>>
>>>> from django.db import models
>>>>
>>>> from django.urls import reverse
>>>>
>>>> import uuid
>>>>
>>>> # Create your models here
>>>>
>>>> class Genre(models.Model):
>>>>
>>>> """Model representing a book genre (e.g. Science Fiction, Non
>>>> Fiction)."""
>>>>
>>>> name = models.CharField(
>>>>
>>>> max_length=200,
>>>>
>>>> help_text="Enter a book genre (e.g. Science Fiction, French
>>>> Poetry etc.)"
>>>>
>>>> )
>>>>
>>>> def __str__(self):
>>>>
>>>> """String for representing the Model object (in Admin site
>>>> etc.)"""
>>>>
>>>> return self.name
>>>>
>>>> class Book(models.Model):
>>>>
>>>> """Model representing a book (but not a specific copy of a book)."""
>>>>
>>>> title = models.CharField(max_length=200)
>>>>
>>>> author = models.ForeignKey('Author', on_delete=models.SET_NULL,
>>>> null=True)
>>>>
>>>> # Foreign Key used because book can only have one author, but
>>>> authors can have multiple books
>>>>
>>>> # Author as a string rather than object because it hasn't been
>>>> declared yet in file.
>>>>
>>>> summary = models.TextField(
>>>>
>>>> max_length=1000, help_tex

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
for example.

class AboutView(TemplateView):
template_name = "about.html"


On Wed, Oct 6, 2021 at 11:32 AM Никита Назаров 
wrote:

> Hello!
> Thank you!
> I'm sorry. How could I do this?
>
> среда, 6 октября 2021 г. в 11:20:19 UTC+3, adeyem...@gmail.com:
>
>> Hi, I observed that you didn't specify the template name attribute for
>> the BookListView and BookDetailView, that should solve you problem.
>>
>> On Tuesday, October 5, 2021 at 10:37:19 PM UTC+2 nazni...@gmail.com
>> wrote:
>>
>>> Hello!
>>> I’m beginner in Django. I do Django Tutorial from Mozilla.
>>> I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I
>>> don’t understand how to resolve it.
>>>
>>> */catalog/urls*
>>>
>>> from django.urls import path
>>>
>>> from . import views
>>>
>>> urlpatterns = [
>>>
>>> path('', views.index, name='index'),
>>>
>>> path('books/', views.BookListView.as_view(), name='books'),
>>>
>>> path('book/', views.BookDetailView.as_view(),
>>> name='book-detail'),
>>>
>>> ]
>>>
>>> *catalog/models*
>>>
>>> # Used to generate URLs by reversing the URL patterns
>>>
>>> from django.urls import reverse
>>>
>>> from django.db import models
>>>
>>> from django.urls import reverse
>>>
>>> import uuid
>>>
>>> # Create your models here
>>>
>>> class Genre(models.Model):
>>>
>>> """Model representing a book genre (e.g. Science Fiction, Non
>>> Fiction)."""
>>>
>>> name = models.CharField(
>>>
>>> max_length=200,
>>>
>>> help_text="Enter a book genre (e.g. Science Fiction, French
>>> Poetry etc.)"
>>>
>>> )
>>>
>>> def __str__(self):
>>>
>>> """String for representing the Model object (in Admin site
>>> etc.)"""
>>>
>>> return self.name
>>>
>>> class Book(models.Model):
>>>
>>> """Model representing a book (but not a specific copy of a book)."""
>>>
>>> title = models.CharField(max_length=200)
>>>
>>> author = models.ForeignKey('Author', on_delete=models.SET_NULL,
>>> null=True)
>>>
>>> # Foreign Key used because book can only have one author, but
>>> authors can have multiple books
>>>
>>> # Author as a string rather than object because it hasn't been
>>> declared yet in file.
>>>
>>> summary = models.TextField(
>>>
>>> max_length=1000, help_text="Enter a brief description of the
>>> book")
>>>
>>> isbn = models.CharField('ISBN', max_length=13,
>>>
>>> unique=True,
>>>
>>> help_text='13 Character https://www.isbn-international.org/content/what-isbn'
>>>
>>>   '">ISBN number')
>>>
>>> genre = models.ManyToManyField(
>>>
>>> Genre, help_text="Select a genre for this book")
>>>
>>> # ManyToManyField used because a genre can contain many books and a
>>> Book can cover many genres.
>>>
>>> # Genre class has already been defined so we can specify the object
>>> above.
>>>
>>> language = models.ForeignKey(
>>>
>>> 'Language', on_delete=models.SET_NULL, null=True)
>>>
>>> class Meta:
>>>
>>> ordering = ['title', 'author']
>>>
>>> def display_genre(self):
>>>
>>> """Creates a string for the Genre. This is required to display
>>> genre in Admin."""
>>>
>>> return ', '.join([genre.name for genre in self.genre.all()[:3]])
>>>
>>> display_genre.short_description = 'Genre'
>>>
>>> def get_absolute_url(self):
>>>
>>> """Returns the url to access a particular book instance."""
>>>
>>> return reverse('book-detail', args=[str(self.id)])
>>>
>>> def __str__(self):
>>>
>>> """String for representing the Model obje

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Никита Назаров
Hello!
Thank you!
I'm sorry. How could I do this? 

среда, 6 октября 2021 г. в 11:20:19 UTC+3, adeyem...@gmail.com: 

> Hi, I observed that you didn't specify the template name attribute for the 
> BookListView and BookDetailView, that should solve you problem.
>
> On Tuesday, October 5, 2021 at 10:37:19 PM UTC+2 nazni...@gmail.com wrote:
>
>> Hello!
>> I’m beginner in Django. I do Django Tutorial from Mozilla.
>> I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I 
>> don’t understand how to resolve it.
>>
>> */catalog/urls*
>>
>> from django.urls import path
>>
>> from . import views
>>
>> urlpatterns = [
>>
>> path('', views.index, name='index'),
>>
>> path('books/', views.BookListView.as_view(), name='books'),
>>
>> path('book/', views.BookDetailView.as_view(), 
>> name='book-detail'),
>>
>> ]
>>
>> *catalog/models*
>>
>> # Used to generate URLs by reversing the URL patterns
>>
>> from django.urls import reverse
>>
>> from django.db import models
>>
>> from django.urls import reverse
>>
>> import uuid
>>
>> # Create your models here
>>
>> class Genre(models.Model):
>>
>> """Model representing a book genre (e.g. Science Fiction, Non 
>> Fiction)."""
>>
>> name = models.CharField(
>>
>> max_length=200,
>>
>> help_text="Enter a book genre (e.g. Science Fiction, French 
>> Poetry etc.)"
>>
>> )
>>
>> def __str__(self):
>>
>> """String for representing the Model object (in Admin site 
>> etc.)"""
>>
>> return self.name
>>
>> class Book(models.Model):
>>
>> """Model representing a book (but not a specific copy of a book)."""
>>
>> title = models.CharField(max_length=200)
>>
>> author = models.ForeignKey('Author', on_delete=models.SET_NULL, 
>> null=True)
>>
>> # Foreign Key used because book can only have one author, but authors 
>> can have multiple books
>>
>> # Author as a string rather than object because it hasn't been 
>> declared yet in file.
>>
>> summary = models.TextField(
>>
>> max_length=1000, help_text="Enter a brief description of the 
>> book")
>>
>> isbn = models.CharField('ISBN', max_length=13,
>>
>> unique=True,
>>
>> help_text='13 Character https://www.isbn-international.org/content/what-isbn'
>>
>>   '">ISBN number')
>>
>> genre = models.ManyToManyField(
>>
>> Genre, help_text="Select a genre for this book")
>>
>> # ManyToManyField used because a genre can contain many books and a 
>> Book can cover many genres.
>>
>> # Genre class has already been defined so we can specify the object 
>> above.
>>
>> language = models.ForeignKey(
>>
>> 'Language', on_delete=models.SET_NULL, null=True)
>>
>> class Meta:
>>
>> ordering = ['title', 'author']
>>
>> def display_genre(self):
>>
>> """Creates a string for the Genre. This is required to display 
>> genre in Admin."""
>>
>> return ', '.join([genre.name for genre in self.genre.all()[:3]])
>>
>> display_genre.short_description = 'Genre'
>>
>> def get_absolute_url(self):
>>
>> """Returns the url to access a particular book instance."""
>>
>> return reverse('book-detail', args=[str(self.id)])
>>
>> def __str__(self):
>>
>> """String for representing the Model object."""
>>
>> return self.title
>>
>> class Language(models.Model):
>>
>> name = models.CharField(
>>
>> max_length=50, help_text="Enter the book's natural language (e.g. 
>> English, French, Japanese etc.)")
>>
>> def __str__(self):
>>
>> return self.name
>>
>> class BookInstance(models.Model):
>>
>> id = models.UUIDField(primary_key=True, default=uuid.uuid4,
>>
>>   help_text="Unique ID for this particular book 
>> across whole library")
>>
>&g

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
Hi, I observed that you didn't specify the template name attribute for the 
BookListView and BookDetailView, that should solve you problem.

On Tuesday, October 5, 2021 at 10:37:19 PM UTC+2 nazni...@gmail.com wrote:

> Hello!
> I’m beginner in Django. I do Django Tutorial from Mozilla.
> I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I 
> don’t understand how to resolve it.
>
> */catalog/urls*
>
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
>
> path('', views.index, name='index'),
>
> path('books/', views.BookListView.as_view(), name='books'),
>
> path('book/', views.BookDetailView.as_view(), 
> name='book-detail'),
>
> ]
>
> *catalog/models*
>
> # Used to generate URLs by reversing the URL patterns
>
> from django.urls import reverse
>
> from django.db import models
>
> from django.urls import reverse
>
> import uuid
>
> # Create your models here
>
> class Genre(models.Model):
>
> """Model representing a book genre (e.g. Science Fiction, Non 
> Fiction)."""
>
> name = models.CharField(
>
> max_length=200,
>
> help_text="Enter a book genre (e.g. Science Fiction, French Poetry 
> etc.)"
>
> )
>
> def __str__(self):
>
> """String for representing the Model object (in Admin site etc.)"""
>
> return self.name
>
> class Book(models.Model):
>
> """Model representing a book (but not a specific copy of a book)."""
>
> title = models.CharField(max_length=200)
>
> author = models.ForeignKey('Author', on_delete=models.SET_NULL, 
> null=True)
>
> # Foreign Key used because book can only have one author, but authors 
> can have multiple books
>
> # Author as a string rather than object because it hasn't been 
> declared yet in file.
>
> summary = models.TextField(
>
> max_length=1000, help_text="Enter a brief description of the book")
>
> isbn = models.CharField('ISBN', max_length=13,
>
> unique=True,
>
> help_text='13 Character https://www.isbn-international.org/content/what-isbn'
>
>   '">ISBN number')
>
> genre = models.ManyToManyField(
>
> Genre, help_text="Select a genre for this book")
>
> # ManyToManyField used because a genre can contain many books and a 
> Book can cover many genres.
>
> # Genre class has already been defined so we can specify the object 
> above.
>
> language = models.ForeignKey(
>
> 'Language', on_delete=models.SET_NULL, null=True)
>
> class Meta:
>
> ordering = ['title', 'author']
>
> def display_genre(self):
>
> """Creates a string for the Genre. This is required to display 
> genre in Admin."""
>
> return ', '.join([genre.name for genre in self.genre.all()[:3]])
>
> display_genre.short_description = 'Genre'
>
> def get_absolute_url(self):
>
> """Returns the url to access a particular book instance."""
>
> return reverse('book-detail', args=[str(self.id)])
>
> def __str__(self):
>
> """String for representing the Model object."""
>
> return self.title
>
> class Language(models.Model):
>
> name = models.CharField(
>
> max_length=50, help_text="Enter the book's natural language (e.g. 
> English, French, Japanese etc.)")
>
> def __str__(self):
>
> return self.name
>
> class BookInstance(models.Model):
>
> id = models.UUIDField(primary_key=True, default=uuid.uuid4,
>
>   help_text="Unique ID for this particular book 
> across whole library")
>
> book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True)
>
> imprint = models.CharField(max_length=200)
>
> due_back = models.DateField(null=True, blank=True)
>
> LOAN_STATUS = (
>
> ('m', 'Maintenance'),
>
> ('o', 'On loan'),
>
> ('a', 'Available'),
>
> ('r', 'Reserved'),
>
> )
>
> status = models.CharField(max_length=1, choices=LOAN_STATUS,
>
>   blank=True, default='m', help_text='Book 
> availability')
>
> class Meta:
>
> ordering = ["due_back"]
>
> def __str__(self):
>
> "&quo

TemplateDoesNotExist at /catalog/books/

2021-10-05 Thread Никита Назаров


Hello!
I’m beginner in Django. I do Django Tutorial from Mozilla.
I get TemplateDoesNotExist at /catalog/books/ . Could you help me?. I don’t 
understand how to resolve it.

*/catalog/urls*

from django.urls import path

from . import views

urlpatterns = [

path('', views.index, name='index'),

path('books/', views.BookListView.as_view(), name='books'),

path('book/', views.BookDetailView.as_view(), 
name='book-detail'),

]

*catalog/models*

# Used to generate URLs by reversing the URL patterns

from django.urls import reverse

from django.db import models

from django.urls import reverse

import uuid

# Create your models here

class Genre(models.Model):

"""Model representing a book genre (e.g. Science Fiction, Non 
Fiction)."""

name = models.CharField(

max_length=200,

help_text="Enter a book genre (e.g. Science Fiction, French Poetry 
etc.)"

)

def __str__(self):

"""String for representing the Model object (in Admin site etc.)"""

return self.name

class Book(models.Model):

"""Model representing a book (but not a specific copy of a book)."""

title = models.CharField(max_length=200)

author = models.ForeignKey('Author', on_delete=models.SET_NULL, 
null=True)

# Foreign Key used because book can only have one author, but authors 
can have multiple books

# Author as a string rather than object because it hasn't been declared 
yet in file.

summary = models.TextField(

max_length=1000, help_text="Enter a brief description of the book")

isbn = models.CharField('ISBN', max_length=13,

unique=True,

help_text='13 Character https://www.isbn-international.org/content/what-isbn'

  '">ISBN number')

genre = models.ManyToManyField(

Genre, help_text="Select a genre for this book")

# ManyToManyField used because a genre can contain many books and a 
Book can cover many genres.

# Genre class has already been defined so we can specify the object 
above.

language = models.ForeignKey(

'Language', on_delete=models.SET_NULL, null=True)

class Meta:

ordering = ['title', 'author']

def display_genre(self):

"""Creates a string for the Genre. This is required to display 
genre in Admin."""

return ', '.join([genre.name for genre in self.genre.all()[:3]])

display_genre.short_description = 'Genre'

def get_absolute_url(self):

"""Returns the url to access a particular book instance."""

return reverse('book-detail', args=[str(self.id)])

def __str__(self):

"""String for representing the Model object."""

return self.title

class Language(models.Model):

name = models.CharField(

max_length=50, help_text="Enter the book's natural language (e.g. 
English, French, Japanese etc.)")

def __str__(self):

return self.name

class BookInstance(models.Model):

id = models.UUIDField(primary_key=True, default=uuid.uuid4,

  help_text="Unique ID for this particular book 
across whole library")

book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True)

imprint = models.CharField(max_length=200)

due_back = models.DateField(null=True, blank=True)

LOAN_STATUS = (

('m', 'Maintenance'),

('o', 'On loan'),

('a', 'Available'),

('r', 'Reserved'),

)

status = models.CharField(max_length=1, choices=LOAN_STATUS,

  blank=True, default='m', help_text='Book 
availability')

class Meta:

ordering = ["due_back"]

def __str__(self):

"""

String for representing the Model object

"""

return '%s (%s)' % (self.id, self.book.title)

class Author(models.Model):

"""

Model representing an author.

"""

first_name = models.CharField(max_length=100)

last_name = models.CharField(max_length=100)

date_of_birth = models.DateField(null=True, blank=True)

date_of_death = models.DateField('Died', null=True, blank=True)


def get_absolute_url(self):

"""

Returns the url to access a particular author instance.

"""

return reverse('author-detail', args=[str(self.id)])


def __str__(self):

"""

String for representing the Model object.

"""

return '%s, %s' % (self.last_name, self.first_name)

*catalog/views*

from django.views import generic

from django.shortcuts import render


# C

Re: TemplateDoesNotExist

2020-12-21 Thread yvin l'EXPLOIT
Follow the Django's official tutorial.

Le lun. 21 déc. 2020 à 17:10, Peter T  a écrit :

> nvm, I fixed it
>
> On Monday, December 21, 2020 at 11:06:31 AM UTC-5 Peter T wrote:
>
>> templatedoesnotexist. I keep getting this error how do I fix it
>>
> --
> 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/1134c32d-b0b5-41d3-aa33-02541f5a660cn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1134c32d-b0b5-41d3-aa33-02541f5a660cn%40googlegroups.com?utm_medium=email_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/CADw1b3EtvXppQPPHzuOyk9JFQOwoS6Hv7RVEfom-w%3DzTb2UmRQ%40mail.gmail.com.


Re: TemplateDoesNotExist

2020-12-21 Thread Peter T
nvm, I fixed it

On Monday, December 21, 2020 at 11:06:31 AM UTC-5 Peter T wrote:

> templatedoesnotexist. I keep getting this error how do I fix it
>

-- 
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/1134c32d-b0b5-41d3-aa33-02541f5a660cn%40googlegroups.com.


TemplateDoesNotExist

2020-12-21 Thread Peter T
templatedoesnotexist. I keep getting this error how do I fix it

-- 
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/8536f888-b712-4d77-b1d1-f03f7d3993ben%40googlegroups.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-03 Thread King Niko
RESOLVED. I managed to fix it.

The problem .. Was so obvious. In *views.py* I did not provide the*
cart.html *and *checkout.html* with the same configurations as *store.html*.
Thus, this caused the 500 server errors. I hope that this thread can help
anyone in the future that encounters a similar predicament.

Thank you all for the assistance.

On Thu, Sep 3, 2020 at 9:43 AM King Niko 
wrote:

> Hi Kasper,
>
> I am getting the following error:
>
> raise TemplateDoesNotExist(template_name, chain=chain)
> django.template.exceptions.TemplateDoesNotExist: ./store/cart.html
>
> How can the template not exist if the other templates exist? Lol, it seems
> impossible.
>
>
> On Thu, Sep 3, 2020 at 8:31 AM Kasper Laudrup 
> wrote:
>
>> Hi King Niko,
>>
>> On 03/09/2020 13.44, King Niko wrote:
>> > Okay, so I fixed everything with Django Logging- including getting the
>> > pictures to show up in the store.
>> >
>>
>> What's written in the Django logs when you get the 500 errors?
>>
>> 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 django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/40fd1120-91a7-d7e3-f08e-9c082aff5ea6%40stacktrace.dk
>> .
>>
>

-- 
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/CAO1EWpFp7EBVMj%3Dr44BEY030Oc45BmHvzjtmFdkGmBZHk9MiuQ%40mail.gmail.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-03 Thread King Niko
Hi Kasper,

I am getting the following error:

raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: ./store/cart.html

How can the template not exist if the other templates exist? Lol, it seems
impossible.


On Thu, Sep 3, 2020 at 8:31 AM Kasper Laudrup  wrote:

> Hi King Niko,
>
> On 03/09/2020 13.44, King Niko wrote:
> > Okay, so I fixed everything with Django Logging- including getting the
> > pictures to show up in the store.
> >
>
> What's written in the Django logs when you get the 500 errors?
>
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/40fd1120-91a7-d7e3-f08e-9c082aff5ea6%40stacktrace.dk
> .
>

-- 
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/CAO1EWpEi-b4q%2BH6229Gyru%3DZJtJawWyaTQ%2BCJf8G_gf7HfPZiw%40mail.gmail.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-03 Thread Kasper Laudrup

Hi King Niko,

On 03/09/2020 13.44, King Niko wrote:
Okay, so I fixed everything with Django Logging- including getting the 
pictures to show up in the store.




What's written in the Django logs when you get the 500 errors?

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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/40fd1120-91a7-d7e3-f08e-9c082aff5ea6%40stacktrace.dk.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-03 Thread King Niko
Okay, so I fixed everything with Django Logging- including getting the
pictures to show up in the store.

However, one thing still remains - recognizing the *store/cart.html* and
*store/checkout.html*

To get the pictures to appear from the DJANGO ADMINISTRATION, I used the
following:


urlpatterns = [
path('admin/', admin.site.urls),
path('', include('store.urls')),
url(r'^images/(?P.)$', serve,{'document_root':
settings.MEDIA_ROOT}),
url(r'^static/(?P.)$', serve,{'document_root':
settings.STATIC_ROOT}),


]

I also tested this to get the *cart.html* and *checkout.html* to stop
showing a TemplateDoesNotExist 500 Server Error:


urlpatterns = [
path('admin/', admin.site.urls),
path('', include('store.urls')),
url(r'^images/(?P.)$', serve,{'document_root':
settings.MEDIA_ROOT}),
url(r'^static/(?P.)$', serve,{'document_root':
settings.STATIC_ROOT}),
url(r'^cart/(?P.)$', serve,{'document_root':
'/store/templates/store'}),
url(r'^checkout/(?P.)$', serve,{'document_root':
'/store/templates/store'}),


]

But still no success. Any suggestions?



On Wed, Sep 2, 2020 at 6:07 PM Kasper Laudrup  wrote:

> Hi King Niko,
>
> On 02/09/2020 17.46, King Niko wrote:
> > *I have not managed to get the Django log up and running, but this may
> > help to get guidance on resolving the issue:*
> >
>
> You should get access to the Django log. It's pointless to waste time on
> guessing what might be wrong when you could have a log file pointing you
> to exactly the line of code which is the cause of your error.
>
> Anyway, regarding your code:
>
> >  try:
> >  cart = json.loads(request.COOKIES['cart'])
> >  except:
>
> Only catch the exceptions you actually expect to be thrown and know how
> to handle. Catching all potential exceptions like you're doing here will
> potentially silence a lot of errors making it much harder for you to
> debug any issues that might occur later on because you ignored the
> original error.
>
> >  except:
> >  pass
>
> This is even more problematic. Here you are simply ignoring any
> exceptions that might be thrown again making it extremely hard to debug
> since you'll just get exceptions or "weird" behavior later on.
>
> Instead of trying to guess what might be wrong, you're lucky enough to
> be using an interpreted language (Python) that can give you some very
> precise error messages if you stop ignoring the errors and get access to
> the logs which will show exactly what went wrong.
>
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/76612162-ff10-06ea-84e5-8a52a31e45e6%40stacktrace.dk
> .
>

-- 
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/CAO1EWpH4pQwLMyyF15uCFJCTGJanRdnWcb2bhvrnhnFx1mP%2BVA%40mail.gmail.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-02 Thread Kasper Laudrup

Hi King Niko,

On 02/09/2020 17.46, King Niko wrote:
*I have not managed to get the Django log up and running, but this may 
help to get guidance on resolving the issue:*




You should get access to the Django log. It's pointless to waste time on 
guessing what might be wrong when you could have a log file pointing you 
to exactly the line of code which is the cause of your error.


Anyway, regarding your code:


     try:
         cart = json.loads(request.COOKIES['cart'])
     except:


Only catch the exceptions you actually expect to be thrown and know how 
to handle. Catching all potential exceptions like you're doing here will 
potentially silence a lot of errors making it much harder for you to 
debug any issues that might occur later on because you ignored the 
original error.



         except:
             pass


This is even more problematic. Here you are simply ignoring any 
exceptions that might be thrown again making it extremely hard to debug 
since you'll just get exceptions or "weird" behavior later on.


Instead of trying to guess what might be wrong, you're lucky enough to 
be using an interpreted language (Python) that can give you some very 
precise error messages if you stop ignoring the errors and get access to 
the logs which will show exactly what went wrong.


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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76612162-ff10-06ea-84e5-8a52a31e45e6%40stacktrace.dk.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-02 Thread King Niko
*I have not managed to get the Django log up and running, but this may help
to get guidance on resolving the issue:*

I have noticed that most of my bugs reside within utils.py under the "cart
= {}" :

def cookieCart(request):
#Create empty cart for now for non-logged in user
try:
cart = json.loads(request.COOKIES['cart'])
except:
  *  cart = {}*
print('CART:', cart)

items = []
order = {'get_cart_total':0, 'get_cart_items':0, 'shipping':False}
cartItems = order['get_cart_items']

for i in cart:
#We use try block to prevent items in cart that may have been
removed from causing error
try:
cartItems += cart[i]['quantity']

product = Product.objects.get(id=i)
total = (product.price * cart[i]['quantity'])

order['get_cart_total'] += total
order['get_cart_items'] += cart[i]['quantity']

item = {
'id':product.id,
'product':{'id':product.id,'name':product.name,
'price':product.price,
'imageURL':product.imageURL},
'quantity':cart[i]['quantity'],
'digital':product.digital,'get_total':total,
}
items.append(item)

if product.digital == False:
order['shipping'] = True
except:
pass

return {'cartItems':cartItems ,'order':order, 'items':items}

def cartData(request):
if request.user.is_authenticated:
customer = request.user.customer
order, created =
Order.objects.get_or_create(customer=customer, complete=False)
items = order.orderitem_set.all()
cartItems=order.get_cart_items
else:
  *  cookieData = cookieCart(request) #This is affected
by the cookieCart function*
cartItems = cookieData['cartItems']
order = cookieData['order']
items = cookieData['items']

return{'cartItems':cartItems, 'order':order, 'items':items}


Maybe this code is what is causing the 500 Server Error? Whenever I look at
the logging in the Heroku logs, it shows the "cart = {}" from utils.py. How
can I resolve this issue? Would you need to see any other pieces of code to
fix this bug?
[11:30 AM]
I also implemented this into my "tests.py" which actually allowed the
website to appear and be functional rather than having 500 Server Errors
all throughout the website. This, somehow, fixed this 500 Server Errors on
every page but the "Cart" and "Checkout". I can still "add" items to my
cart and see the number increase on each page, but when I click the "Cart"
I receive a 500 Server Error - the same occurs when I type in the url for
the "Checkout" page. Here is the code in my "tests.py":

from django.test import TestCase, override_settings

# Create your tests here.
class MyTest(TestCase):

@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.StaticFilesStorage')
def test_something(self):
pass

On Tue, Sep 1, 2020 at 5:01 PM Kasper Laudrup  wrote:

> Hi King Niko,
>
> On 01/09/2020 07.43, King Niko wrote:
> > The console does not seem to provide much information. It is simply
> > stating that there is a 500 Server Error. I tried sifting for more
> > details but there were none.
> >
>
> The console in your browser is not providing any information because it
> doesn't make much sense to try and debug a *Server Error* on the client
> side.
>
> Ignore the advice from RANGA BHARATH JINKA on looking in your browsers
> console.
>
>
> > However, in the:
> >
> > *> heroku logs --tail *
> > *
> > *
> > It simply mentions that none of the paths exist to /the cart / and /the
> > images /that derive from the DJANGO ADMINISTRATION page.
>
> That sounds a lot more useful, but are you really sure you're seeing the
> logs from Django and not just the web server forwarding requests to your
> Django application?
>
> You need to get the logs from your actual Django application to see the
> actual cause of the error. I remember there has been other discussions
> on getting those logs from Heroku, but I have no experience with Heroku
> so I don't know how to achieve that, but you need access to those logs
> sooner or later so start by figuring out how to do that.
>
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/299d7a71-faf2-71aa-fdfb-d5b53bc6127b%40stacktrace.dk
> .
>

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

Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-09-01 Thread Kasper Laudrup

Hi King Niko,

On 01/09/2020 07.43, King Niko wrote:
The console does not seem to provide much information. It is simply 
stating that there is a 500 Server Error. I tried sifting for more 
details but there were none.




The console in your browser is not providing any information because it 
doesn't make much sense to try and debug a *Server Error* on the client 
side.


Ignore the advice from RANGA BHARATH JINKA on looking in your browsers 
console.




However, in the:

*> heroku logs --tail *
*
*
It simply mentions that none of the paths exist to /the cart / and /the 
images /that derive from the DJANGO ADMINISTRATION page.


That sounds a lot more useful, but are you really sure you're seeing the 
logs from Django and not just the web server forwarding requests to your 
Django application?


You need to get the logs from your actual Django application to see the 
actual cause of the error. I remember there has been other discussions 
on getting those logs from Heroku, but I have no experience with Heroku 
so I don't know how to achieve that, but you need access to those logs 
sooner or later so start by figuring out how to do that.


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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/299d7a71-faf2-71aa-fdfb-d5b53bc6127b%40stacktrace.dk.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-08-31 Thread King Niko
The console does not seem to provide much information. It is simply stating
that there is a 500 Server Error. I tried sifting for more details but
there were none.

However, in the:

*> heroku logs --tail *

It simply mentions that none of the paths exist to *the cart * and *the
images *that derive from the DJANGO ADMINISTRATION page. Strangely, all of
the other pages and pictures on the website works. It is rather confusing
to see only the store section of the site encountering this bug.

On Tue, Sep 1, 2020 at 12:45 AM RANGA BHARATH JINKA <
bharathjink...@gmail.com> wrote:

> open console tab not elements tab
>
> On Tue, Sep 1, 2020 at 10:13 AM King Niko <
> thelegendofearthretu...@gmail.com> wrote:
>
>> Interesting, the browser console states the following:
>>
>> 
>> 
>> 
>>   Server Error (500)
>> 
>> 
>>   Server Error (500)
>> 
>> 
>>
>> How could the *title* and *header 1* be causing the Server Error (500)?
>>
>> On Tue, Sep 1, 2020 at 12:39 AM RANGA BHARATH JINKA <
>> bharathjink...@gmail.com> wrote:
>>
>>> Hi,
>>>  check in browser console for errors
>>>
>>> On Tue, Sep 1, 2020 at 2:27 AM Lightning Bit <
>>> thelegendofearthretu...@gmail.com> wrote:
>>>
>>>> I logged into the ADMIN PORTAL and saw that there was an image for each
>>>> item in the ADMIN PORTAL.
>>>>
>>>> Strangely, when returning to the website, I am unable to actually "see"
>>>> the pictures - they are blank with the no file icon in the top left. This
>>>> was not the case back in the testing environment.
>>>>
>>>> Why would this occur only upon publishing the website? It does not seem
>>>> to be registering the images from DJANGO ADMINISTRATION. Also, when I click
>>>> my  cart icon after adding one of the non-image showing items, I receive an
>>>> error 500 stating that the cart.html and only the cart.html
>>>> TemplateDoesNotExist. It has the same settings as every other html page,
>>>> what makes this single page unique to becoming an error 500?
>>>>
>>>> --
>>>> 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/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> Thanks and Regards
>>>
>>> J. Ranga Bharath
>>> cell: 9110334114
>>>
>>> --
>>> 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/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com?utm_medium=email_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/CAO1EWpEJbYvqaEdZ7rkd_B%2BocXjjAsbDTKZ0Aw1HxUCieqqN9w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAO1EWpEJbYvqaEdZ7rkd_B%2BocXjjAsbDTKZ0Aw1HxUCieqqN9w%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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/CAK5m315oAbkVLDFOh_DUOt5WQJg9krn9QSOv-UX2sDNeA5xBWw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK5m315oAbkVLDFOh_DUOt5WQJg9krn9QSOv-UX2sDNeA5xBWw%40mail.gmail.com?utm_medium=email_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/CAO1EWpHGiLfaZmb-E8HBWjR6cyVz2cmrqCnboKGgZtmD4VjKfA%40mail.gmail.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-08-31 Thread RANGA BHARATH JINKA
open console tab not elements tab

On Tue, Sep 1, 2020 at 10:13 AM King Niko 
wrote:

> Interesting, the browser console states the following:
>
> 
> 
> 
>   Server Error (500)
> 
> 
>   Server Error (500)
> 
> 
>
> How could the *title* and *header 1* be causing the Server Error (500)?
>
> On Tue, Sep 1, 2020 at 12:39 AM RANGA BHARATH JINKA <
> bharathjink...@gmail.com> wrote:
>
>> Hi,
>>  check in browser console for errors
>>
>> On Tue, Sep 1, 2020 at 2:27 AM Lightning Bit <
>> thelegendofearthretu...@gmail.com> wrote:
>>
>>> I logged into the ADMIN PORTAL and saw that there was an image for each
>>> item in the ADMIN PORTAL.
>>>
>>> Strangely, when returning to the website, I am unable to actually "see"
>>> the pictures - they are blank with the no file icon in the top left. This
>>> was not the case back in the testing environment.
>>>
>>> Why would this occur only upon publishing the website? It does not seem
>>> to be registering the images from DJANGO ADMINISTRATION. Also, when I click
>>> my  cart icon after adding one of the non-image showing items, I receive an
>>> error 500 stating that the cart.html and only the cart.html
>>> TemplateDoesNotExist. It has the same settings as every other html page,
>>> what makes this single page unique to becoming an error 500?
>>>
>>> --
>>> 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/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> --
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> cell: 9110334114
>>
>> --
>> 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/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com?utm_medium=email_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/CAO1EWpEJbYvqaEdZ7rkd_B%2BocXjjAsbDTKZ0Aw1HxUCieqqN9w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAO1EWpEJbYvqaEdZ7rkd_B%2BocXjjAsbDTKZ0Aw1HxUCieqqN9w%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m315oAbkVLDFOh_DUOt5WQJg9krn9QSOv-UX2sDNeA5xBWw%40mail.gmail.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-08-31 Thread King Niko
Interesting, the browser console states the following:




  Server Error (500)


  Server Error (500)



How could the *title* and *header 1* be causing the Server Error (500)?

On Tue, Sep 1, 2020 at 12:39 AM RANGA BHARATH JINKA <
bharathjink...@gmail.com> wrote:

> Hi,
>  check in browser console for errors
>
> On Tue, Sep 1, 2020 at 2:27 AM Lightning Bit <
> thelegendofearthretu...@gmail.com> wrote:
>
>> I logged into the ADMIN PORTAL and saw that there was an image for each
>> item in the ADMIN PORTAL.
>>
>> Strangely, when returning to the website, I am unable to actually "see"
>> the pictures - they are blank with the no file icon in the top left. This
>> was not the case back in the testing environment.
>>
>> Why would this occur only upon publishing the website? It does not seem
>> to be registering the images from DJANGO ADMINISTRATION. Also, when I click
>> my  cart icon after adding one of the non-image showing items, I receive an
>> error 500 stating that the cart.html and only the cart.html
>> TemplateDoesNotExist. It has the same settings as every other html page,
>> what makes this single page unique to becoming an error 500?
>>
>> --
>> 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/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com?utm_medium=email_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/CAO1EWpEJbYvqaEdZ7rkd_B%2BocXjjAsbDTKZ0Aw1HxUCieqqN9w%40mail.gmail.com.


Re: DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-08-31 Thread RANGA BHARATH JINKA
Hi,
 check in browser console for errors

On Tue, Sep 1, 2020 at 2:27 AM Lightning Bit <
thelegendofearthretu...@gmail.com> wrote:

> I logged into the ADMIN PORTAL and saw that there was an image for each
> item in the ADMIN PORTAL.
>
> Strangely, when returning to the website, I am unable to actually "see"
> the pictures - they are blank with the no file icon in the top left. This
> was not the case back in the testing environment.
>
> Why would this occur only upon publishing the website? It does not seem to
> be registering the images from DJANGO ADMINISTRATION. Also, when I click
> my  cart icon after adding one of the non-image showing items, I receive an
> error 500 stating that the cart.html and only the cart.html
> TemplateDoesNotExist. It has the same settings as every other html page,
> what makes this single page unique to becoming an error 500?
>
> --
> 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/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m317sPQakSxmtQVHWO8cMXWCss6F3d_FX2Gj8T-%2BELo0-Dw%40mail.gmail.com.


DJANGO ADMINISTRATION ERROR & TemplateDoesNotExist

2020-08-31 Thread Lightning Bit
I logged into the ADMIN PORTAL and saw that there was an image for each 
item in the ADMIN PORTAL. 

Strangely, when returning to the website, I am unable to actually "see" the 
pictures - they are blank with the no file icon in the top left. This was 
not the case back in the testing environment.

Why would this occur only upon publishing the website? It does not seem to 
be registering the images from DJANGO ADMINISTRATION. Also, when I click 
my  cart icon after adding one of the non-image showing items, I receive an 
error 500 stating that the cart.html and only the cart.html 
TemplateDoesNotExist. It has the same settings as every other html page, 
what makes this single page unique to becoming an error 500? 

-- 
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/f5e9e088-110e-4d2a-a70e-43d87bd6fdb1n%40googlegroups.com.


Re: TemplateDoesNotExist at /accounts/logout/ logout.html

2020-01-07 Thread Kasper Laudrup

Hi Parvez.

On 07/01/2020 10.13, Parvez Khan Pathan wrote:
i'm new to django and learning from Udemy Bootcamp course but i make 
Blog Post WEb using django Everything is work good Except Logout
can you please help out where made i mistake... 


If you read the error messages it clearly shows what the problem is and 
more or less giving you a solution as well.


You need a template called "logout.html" and the error page tells you 
where it was looking for that template in the "Template-loader 
postmortem" part.


This guide might be helpful:

https://simpleisbetterthancomplex.com/tutorial/2016/06/27/how-to-use-djangos-built-in-login-system.html

Hope that helps.

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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e33a78d9-6f44-dcce-85d9-cd251521ebf4%40stacktrace.dk.


Re: TemplateDoesNotExist at /accounts/logout/ logout.html

2020-01-07 Thread ramadhan ngallen
Hello
The template directory(name) is not correct. Kindly change template directory 
to "registration/logout.html" instead of "logout.html"

Best Regards

Ramadhan Ngallen
Software Consultant

Phone: +255 715 200 997 | ngall...@gmail.com
On 7 Jan 2020, 12:24 +0300, Bruckner de Villiers 
, wrote:
> Parvez,
> Please paste the code, not a pic of the code – it’s too small to read.
>
> Bruckner de Villiers
> 083 625 1086
>
> From:  on behalf of Parvez Khan Pathan 
> 
> Reply to: 
> Date: Tuesday, 07 January 2020 at 11:15
> To: Django users 
> Subject: TemplateDoesNotExist at /accounts/logout/ logout.html
>
> Hello & afternoon
>
> i'm new to django and learning from Udemy Bootcamp course but i make Blog 
> Post WEb using django Everything is work good Except Logout
> can you please help out where made i mistake... even i check many 
> Stackoverflow solution but not work for me even Django Documentation is 
> complex too!
>
> This is URL Code:
>
> 
>
>
> This is Template error:
>
> 
>
>
>
> Regard;
> Parvez Khan Pathan
>
> --
> 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/7a56322b-aa52-47e8-8398-e4daec2795ca%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/A438740E-9A01-48D1-A5D4-97E48F0685D8%40gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0a7e4e89-7686-4ef8-9724-e5f88519a190%40Spark.


Re: TemplateDoesNotExist

2019-10-04 Thread Desh Deepak
yourapp/urls.py

from django.urls import path

from . import path

urlpatterns =[
   path(' ', views.index, name='index'),
]



views.py

def index(request):
   return render(request, 'index.html')






On Thu, 3 Oct 2019, 17:03 Tosin Ayoola,  wrote:

> Did you set your template folder correctly in your setting file and in
> your view are you pointing to the right directory where your .html is
> located?
>
> On Oct 3, 2019 08:18, "yerri swamy"  wrote:
>
> I tried like this
> testapp>template>base.html
> but also its showing same issue please help me anyone..
> views.py
>
>1.
>
>from django.shortcuts import render
>
>2.
>3.
>
># Create your views here.
>
>4.
>
>def hello_world(request):
>
>5.
>
>   
>
>1.
>
>   return render(request,'testapp/template/base.html',{})
>
>
>
> On Wed, Sep 25, 2019 at 11:34 AM Desh Deepak 
> wrote:
>
>> Create template folder inside testapp.
>>
>> Like this:
>> testapp>template>base.html
>>
>>
>>
>> On Wed, 25 Sep 2019, 10:47 yerri swamy, 
>> wrote:
>>
>>>
>>>
>>> On Mon, Sep 23, 2019 at 6:53 PM Desh Deepak 
>>> wrote:
>>>
 Show me your views.py file.

 On Mon, 23 Sep 2019, 18:48 Abu Yusuf, 
 wrote:

> 1. ensure you have a folder templates inside static folder
> 2. ensure you filled up templates_dir: 'templates'
> 3. ensure 'base.html' exists inside templates folder
>
> On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
> wrote:
>
>> Hi guys,
>>
>> By using templates folder i am not getting what i am
>> expecting and i am getting error 'Template Does Not Exist' ,and also
>> defaulty it's not coming templates variable in settings.py file,How do i
>> slove this error please explain me any one.
>>
>> --
>> 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO0C%3DUQg%40mail.gmail.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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAKMSwL-OH3MOgjE5YDwVtsH-2xPv5oNxvuWHna8MZYUXS0iR0A%40mail.gmail.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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJ0m4xhvoPjpgJXQKk61oG4rfnVRnUwLCX1CgYH%3DGdze8BGAfw%40mail.gmail.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re: TemplateDoesNotExist

2019-10-03 Thread saeed albooyeh
hi 
you can see the template-loader postmortem part of the error page that you 
uploaded 
there is a list of paths that django expects to find your templates due to 
your settings file 
in the settings file you can see the TEMPLATES list and find out where you 
should place your templates
for example if APPS_DIRS is True so django will search for templates in 
every apps directory alongside other paths 
in general it is better to put your templates into a folder named same as 
your app that is inside another folder named templates in your app dir 
for example app_dir/templates/app_name/template.html

On Monday, September 23, 2019 at 4:11:56 PM UTC+3:30, yerri swamy wrote:
>
> Hi guys, 
>   
> By using templates folder i am not getting what i am expecting and 
> i am getting error 'Template Does Not Exist' ,and also defaulty it's not 
> coming templates variable in settings.py file,How do i slove this error 
> please explain me any one.   
>

-- 
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/f01203cf-4e87-4179-9dca-d3e19fc6d906%40googlegroups.com.


Re: TemplateDoesNotExist

2019-10-03 Thread Tosin Ayoola
Did you set your template folder correctly in your setting file and in your
view are you pointing to the right directory where your .html is located?

On Oct 3, 2019 08:18, "yerri swamy"  wrote:

I tried like this
testapp>template>base.html
but also its showing same issue please help me anyone..
views.py

   1.

   from django.shortcuts import render

   2.
   3.

   # Create your views here.

   4.

   def hello_world(request):

   5.



   1.

return render(request,'testapp/template/base.html',{})



On Wed, Sep 25, 2019 at 11:34 AM Desh Deepak 
wrote:

> Create template folder inside testapp.
>
> Like this:
> testapp>template>base.html
>
>
>
> On Wed, 25 Sep 2019, 10:47 yerri swamy,  wrote:
>
>>
>>
>> On Mon, Sep 23, 2019 at 6:53 PM Desh Deepak 
>> wrote:
>>
>>> Show me your views.py file.
>>>
>>> On Mon, 23 Sep 2019, 18:48 Abu Yusuf, 
>>> wrote:
>>>
 1. ensure you have a folder templates inside static folder
 2. ensure you filled up templates_dir: 'templates'
 3. ensure 'base.html' exists inside templates folder

 On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
 wrote:

> Hi guys,
>
> By using templates folder i am not getting what i am expecting
> and i am getting error 'Template Does Not Exist' ,and also defaulty it's
> not coming templates variable in settings.py file,How do i slove this 
> error
> please explain me any one.
>
> --
> 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/208e411a-a8f5-4238-b846-f086826f2ff4%
> 40googlegroups.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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%
 3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO
>>> 0C%3DUQg%40mail.gmail.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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/CAKMSwL-OH3MOgjE5YDwVtsH-2xPv5oNxvuWHna8MZYUXS0iR0A%
>> 40mail.gmail.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAJ0m4xhvoPjpgJXQKk61oG4rfnVRnUwLCX1CgYH%3DGdze8BGAfw%
> 40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/CAKMSwL-WqaCjmAvqX23kcWT%2BrCv6b25PjQxq-9AKjPkYNOVm2g%
40mail.gmail.com

.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group 

Re: TemplateDoesNotExist

2019-10-03 Thread Ehab Al-Qabbani
Hi,

Add new folder with the application name under the template folder i.e 
"testapp/templates/testapp"
And move your template files into new folder,
Then, when you call the template:
If the template in the same place of the view.py (application space) call it 
without the full path i.e "base.html"

If you want to call it from another application call it with application name 
prefix i.e "testapp/base.html"

Don't forget to configure settings.py.


Warmest Regards,
Ehab

From: django-users@googlegroups.com on behalf of yerri swamy 

Sent: Thursday, October 3, 2019 9:18 AM
To: django-users@googlegroups.com
Subject: Re: TemplateDoesNotExist

I tried like this
testapp>template>base.html
but also its showing same issue please help me anyone..
views.py

  1.

from django.shortcuts import render

  2.
  3.

# Create your views here.

  4.

def hello_world(request):

  5.



  1.

return render(request,'testapp/template/base.html',{})

On Wed, Sep 25, 2019 at 11:34 AM Desh Deepak 
mailto:deshdeepak...@gmail.com>> wrote:
Create template folder inside testapp.

Like this:
testapp>template>base.html



On Wed, 25 Sep 2019, 10:47 yerri swamy, 
mailto:dussayerrisw...@gmail.com>> wrote:


On Mon, Sep 23, 2019 at 6:53 PM Desh Deepak 
mailto:deshdeepak...@gmail.com>> wrote:
Show me your views.py file.

On Mon, 23 Sep 2019, 18:48 Abu Yusuf, 
mailto:yu...@binate-solutions.com>> wrote:
1. ensure you have a folder templates inside static folder
2. ensure you filled up templates_dir: 'templates'
3. ensure 'base.html' exists inside templates folder

On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
mailto:dussayerrisw...@gmail.com>> wrote:
Hi guys,

By using templates folder i am not getting what i am expecting and i am 
getting error 'Template Does Not Exist' ,and also defaulty it's not coming 
templates variable in settings.py file,How do i slove this error please explain 
me any one.

--
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 
todjango-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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.com<https://groups.google.com/d/msgid/django-users/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.com?utm_medium=email_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 
todjango-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/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.com?utm_medium=email_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 
todjango-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/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO0C%3DUQg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO0C%3DUQg%40mail.gmail.com?utm_medium=email_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 
todjango-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/CAKMSwL-OH3MOgjE5YDwVtsH-2xPv5oNxvuWHna8MZYUXS0iR0A%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAKMSwL-OH3MOgjE5YDwVtsH-2xPv5oNxvuWHna8MZYUXS0iR0A%40mail.gmail.com?utm_medium=email_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 
todjango-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/CAJ0m4xhvoPjpgJXQKk61oG4rfnVRnUwLCX1CgYH%3DGdze8BGAfw%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAJ0m4xhvoPjpgJXQKk61oG4rfnVRnUwLCX1CgYH%3DGdze8BGAfw%40mail.gmai

Re: TemplateDoesNotExist

2019-10-03 Thread yerri swamy
I tried like this
testapp>template>base.html
but also its showing same issue please help me anyone..
views.py

   1.

   from django.shortcuts import render

   2.
   3.

   # Create your views here.

   4.

   def hello_world(request):

   5.



   1.

return render(request,'testapp/template/base.html',{})



On Wed, Sep 25, 2019 at 11:34 AM Desh Deepak 
wrote:

> Create template folder inside testapp.
>
> Like this:
> testapp>template>base.html
>
>
>
> On Wed, 25 Sep 2019, 10:47 yerri swamy,  wrote:
>
>>
>>
>> On Mon, Sep 23, 2019 at 6:53 PM Desh Deepak 
>> wrote:
>>
>>> Show me your views.py file.
>>>
>>> On Mon, 23 Sep 2019, 18:48 Abu Yusuf, 
>>> wrote:
>>>
 1. ensure you have a folder templates inside static folder
 2. ensure you filled up templates_dir: 'templates'
 3. ensure 'base.html' exists inside templates folder

 On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
 wrote:

> Hi guys,
>
> By using templates folder i am not getting what i am expecting
> and i am getting error 'Template Does Not Exist' ,and also defaulty it's
> not coming templates variable in settings.py file,How do i slove this 
> error
> please explain me any one.
>
> --
> 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO0C%3DUQg%40mail.gmail.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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAKMSwL-OH3MOgjE5YDwVtsH-2xPv5oNxvuWHna8MZYUXS0iR0A%40mail.gmail.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ0m4xhvoPjpgJXQKk61oG4rfnVRnUwLCX1CgYH%3DGdze8BGAfw%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKMSwL-WqaCjmAvqX23kcWT%2BrCv6b25PjQxq-9AKjPkYNOVm2g%40mail.gmail.com.


Re: TemplateDoesNotExist

2019-09-25 Thread Desh Deepak
Create template folder inside testapp.

Like this:
testapp>template>base.html



On Wed, 25 Sep 2019, 10:47 yerri swamy,  wrote:

>
>
> On Mon, Sep 23, 2019 at 6:53 PM Desh Deepak 
> wrote:
>
>> Show me your views.py file.
>>
>> On Mon, 23 Sep 2019, 18:48 Abu Yusuf,  wrote:
>>
>>> 1. ensure you have a folder templates inside static folder
>>> 2. ensure you filled up templates_dir: 'templates'
>>> 3. ensure 'base.html' exists inside templates folder
>>>
>>> On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
>>> wrote:
>>>
 Hi guys,

 By using templates folder i am not getting what i am expecting
 and i am getting error 'Template Does Not Exist' ,and also defaulty it's
 not coming templates variable in settings.py file,How do i slove this error
 please explain me any one.

 --
 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO0C%3DUQg%40mail.gmail.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKMSwL-OH3MOgjE5YDwVtsH-2xPv5oNxvuWHna8MZYUXS0iR0A%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ0m4xhvoPjpgJXQKk61oG4rfnVRnUwLCX1CgYH%3DGdze8BGAfw%40mail.gmail.com.


Re: TemplateDoesNotExist

2019-09-23 Thread Manish Maurya
create  a folder name as template in your django project and open your
settings.py file  in template in dir write "templates"


On Mon, 23 Sep 2019 at 19:56, oba stephen  wrote:

> Try using "./base.html"
>
> I believe this should do it.
>
> On Mon, Sep 23, 2019, 1:40 PM yerri swamy 
> wrote:
>
>> Hi guys,
>>
>> By using templates folder i am not getting what i am expecting
>> and i am getting error 'Template Does Not Exist' ,and also defaulty it's
>> not coming templates variable in settings.py file,How do i slove this error
>> please explain me any one.
>>
>> --
>> 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAJsLnoeWbqy6TFuph1j2%2ByaZuek1wFLUbGdYObf_RYzSOEusA%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANyc5fe6cJh-8JwPYKoPsERTpFfYTst1py%2BnHHqhgVzTBdxKYg%40mail.gmail.com.


Re: TemplateDoesNotExist

2019-09-23 Thread Tosin Ayoola
Can you paste the section of your view code & Hw are you referencing your
base.html is it directly in ur templates folder?

On Sep 23, 2019 13:40, "yerri swamy"  wrote:

Hi guys,

By using templates folder i am not getting what i am expecting and
i am getting error 'Template Does Not Exist' ,and also defaulty it's not
coming templates variable in settings.py file,How do i slove this error
please explain me any one.

-- 
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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHLKn72RA0QThHM0GLNuPAdm9r46fKExeFsgSKy5sj%2Bk_btHVw%40mail.gmail.com.


RE: TemplateDoesNotExist

2019-09-23 Thread laya
Hi ,
You should config the template settings:
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],


Sent from Mail for Windows 10

From: yerri swamy
Sent: Monday, September 23, 2019 4:11 PM
To: Django users
Subject: TemplateDoesNotExist

Hi guys, 
  
    By using templates folder i am not getting what i am expecting and i am 
getting error 'Template Does Not Exist' ,and also defaulty it's not coming 
templates variable in settings.py file,How do i slove this error please explain 
me any one.   
-- 
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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d890eb1.1c69fb81.aa801.2119%40mx.google.com.


Re: TemplateDoesNotExist

2019-09-23 Thread anilumarane
Give the html file current pathSent from my Samsung Galaxy smartphone.
 Original message From: oba stephen  
Date: 23/09/2019  19:55  (GMT+05:30) To: django-users@googlegroups.com Subject: 
Re: TemplateDoesNotExist Try using "./base.html"I believe this should do it. On 
Mon, Sep 23, 2019, 1:40 PM yerri swamy  wrote:Hi 
guys,       By using templates folder i am not getting what i am 
expecting and i am getting error 'Template Does Not Exist' ,and also defaulty 
it's not coming templates variable in settings.py file,How do i slove this 
error please explain me any one.   



-- 
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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAJsLnoeWbqy6TFuph1j2%2ByaZuek1wFLUbGdYObf_RYzSOEusA%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d88e2a2.1c69fb81.175a3.2a78%40mx.google.com.


Re: TemplateDoesNotExist

2019-09-23 Thread oba stephen
Try using "./base.html"

I believe this should do it.

On Mon, Sep 23, 2019, 1:40 PM yerri swamy  wrote:

> Hi guys,
>
> By using templates folder i am not getting what i am expecting and
> i am getting error 'Template Does Not Exist' ,and also defaulty it's not
> coming templates variable in settings.py file,How do i slove this error
> please explain me any one.
>
> --
> 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAJsLnoeWbqy6TFuph1j2%2ByaZuek1wFLUbGdYObf_RYzSOEusA%40mail.gmail.com.


Re: TemplateDoesNotExist

2019-09-23 Thread Desh Deepak
Show me your views.py file.

On Mon, 23 Sep 2019, 18:48 Abu Yusuf,  wrote:

> 1. ensure you have a folder templates inside static folder
> 2. ensure you filled up templates_dir: 'templates'
> 3. ensure 'base.html' exists inside templates folder
>
> On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
> wrote:
>
>> Hi guys,
>>
>> By using templates folder i am not getting what i am expecting
>> and i am getting error 'Template Does Not Exist' ,and also defaulty it's
>> not coming templates variable in settings.py file,How do i slove this error
>> please explain me any one.
>>
>> --
>> 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ0m4xiPWfJ%3Dt-CjkDL81F7wn5ETmcBRacMyBi5n0zpO0C%3DUQg%40mail.gmail.com.


Re: TemplateDoesNotExist

2019-09-23 Thread Abu Yusuf
1. ensure you have a folder templates inside static folder
2. ensure you filled up templates_dir: 'templates'
3. ensure 'base.html' exists inside templates folder

On Mon, Sep 23, 2019 at 6:40 PM yerri swamy 
wrote:

> Hi guys,
>
> By using templates folder i am not getting what i am expecting and
> i am getting error 'Template Does Not Exist' ,and also defaulty it's not
> coming templates variable in settings.py file,How do i slove this error
> please explain me any one.
>
> --
> 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/208e411a-a8f5-4238-b846-f086826f2ff4%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACNsr29mvap_G4%2Bc70NrkDZEQvPye%3D22caxfBvdUvMt_b7kXqQ%40mail.gmail.com.


Re: Django 2.7.1 - "TemplateDoesNotExist at /munichlivingapp/seekers/ "

2019-03-30 Thread kamibarut609
Hello Mohammad.

thank you for your help.

If you read carefully the content of the thread, you will see that all the 
code was posted and I was able to figure things out thanks to the help of 
the developer.

K.

On Saturday, 30 March 2019 16:29:58 UTC+1, Mohammad Etemaddar wrote:
>
> Dear Kabiba,
> It would be good to post your code (specially the part that renders the 
> template). I think you're addressing the template by 'seeker_list.html'.
> You need to specify the mother directory 'munichi...app/seeker_list.html'.
> or put seeker_list.html right inside the templates directory.
>
> On Saturday, March 30, 2019 at 6:40:08 PM UTC+4:30, kamiba...@gmail.com 
> wrote:
>>
>> Hello,
>>
>> I thought I would post here the link to the question (which was not 
>> answered)  I just asked on Stackoverflow.
>>
>>
>> https://stackoverflow.com/questions/55431695/django-2-7-1-templatedoesnotexist-at-munichlivingapp-seekers
>>
>> Any suggestions are welcome. Thanks.
>>
>> K.
>>
>>
>>

-- 
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 post to this group, send email to django-users@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/b5681d25-5c3e-4cf5-9c52-7bea8a4af64b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.7.1 - "TemplateDoesNotExist at /munichlivingapp/seekers/ "

2019-03-30 Thread Mohammad Etemaddar
Dear Kabiba,
It would be good to post your code (specially the part that renders the 
template). I think you're addressing the template by 'seeker_list.html'.
You need to specify the mother directory 'munichi...app/seeker_list.html'.
or put seeker_list.html right inside the templates directory.

On Saturday, March 30, 2019 at 6:40:08 PM UTC+4:30, kamiba...@gmail.com 
wrote:
>
> Hello,
>
> I thought I would post here the link to the question (which was not 
> answered)  I just asked on Stackoverflow.
>
>
> https://stackoverflow.com/questions/55431695/django-2-7-1-templatedoesnotexist-at-munichlivingapp-seekers
>
> Any suggestions are welcome. Thanks.
>
> K.
>
>
>

-- 
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 post to this group, send email to django-users@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/0ad1beef-8229-4fb5-bab1-5158ed4fe850%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2.7.1 - "TemplateDoesNotExist at /munichlivingapp/seekers/ "

2019-03-30 Thread kamibarut609
Hello,

I thought I would post here the link to the question (which was not 
answered)  I just asked on Stackoverflow.

https://stackoverflow.com/questions/55431695/django-2-7-1-templatedoesnotexist-at-munichlivingapp-seekers

Any suggestions are welcome. Thanks.

K.


-- 
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 post to this group, send email to django-users@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/183069ca-3a2d-418e-a534-95626385bff3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist at /vmail/inbox/

2019-02-05 Thread senthu nithy
Get i,Thank you!
K.Senthuja
Undergraduate Student (UOJ),
https://www.linkedin.com/in/senthuja/
https://medium.com/@senthujakarunanithy


On Tue, Feb 5, 2019 at 8:53 AM Alex Kimeu  wrote:

> It means the template you are trying to render is either not created or
> not in the location where Django expects to be. Django does not see the
> template you are trying to render.
>
> On Tue, 5 Feb 2019, 04:28 senthu nithy 
>> I am doing a project using Django. I got this error. I don't understand
>> what this error really means.
>> Thanks in advance!
>> K.Senthuja
>> Undergraduate Student (UOJ),
>> https://www.linkedin.com/in/senthuja/
>> https://medium.com/@senthujakarunanithy
>>
>> --
>> 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 post to this group, send email to django-users@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/CALEaTU5PQaiOuekpgJS7B6gQkZeQEz-x8--RMmLvC9mjJDnFNw%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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/CACYP3VHVfVCm7LHqt7x6bNN78%2BwjXnVaC4YQEzaXxQygwz1HFg%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CALEaTU57SpT6561P5obA%2BnOr5_6cRKNFXsP_CuAHesXotppFbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist at /vmail/inbox/

2019-02-04 Thread Alex Kimeu
It means the template you are trying to render is either not created or not
in the location where Django expects to be. Django does not see the
template you are trying to render.

On Tue, 5 Feb 2019, 04:28 senthu nithy  I am doing a project using Django. I got this error. I don't understand
> what this error really means.
> Thanks in advance!
> K.Senthuja
> Undergraduate Student (UOJ),
> https://www.linkedin.com/in/senthuja/
> https://medium.com/@senthujakarunanithy
>
> --
> 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 post to this group, send email to django-users@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/CALEaTU5PQaiOuekpgJS7B6gQkZeQEz-x8--RMmLvC9mjJDnFNw%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CACYP3VHVfVCm7LHqt7x6bNN78%2BwjXnVaC4YQEzaXxQygwz1HFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist Error on deploying

2018-01-13 Thread yingi keme
Okk Jani. I will take note of that too..

Thanks

Yingi Kem

> On 13 Jan 2018, at 10:28 PM, Jani Tiainen <rede...@gmail.com> 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" <yingik...@gmail.com> kirjoitti:
>> Thanks Kasper. It was the backslash.
>> 
>> Thanks for saving me...
>> 
>> Yingi Kem
>> 
>> > On 13 Jan 2018, at 2:52 PM, Kasper Laudrup <laud...@stacktrace.dk> 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 django-users+unsubscr...@googlegroups.com.
>> > To post to this group, send email to django-users@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/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 django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@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/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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/BD865F69-AC28-4E6A-A385-AC2F2A2418FD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist Error on deploying

2018-01-13 Thread 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" <yingik...@gmail.com> kirjoitti:

> Thanks Kasper. It was the backslash.
>
> Thanks for saving me...
>
> Yingi Kem
>
> > On 13 Jan 2018, at 2:52 PM, Kasper Laudrup <laud...@stacktrace.dk>
> 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 django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@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/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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAHn91oeFU1zweEcrQBR0-dE%2BuB8PYc_58LYHMMybu8ZVDDjBMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist Error on deploying

2018-01-13 Thread yingi keme
Thanks Kasper. It was the backslash. 

Thanks for saving me...

Yingi Kem

> On 13 Jan 2018, at 2:52 PM, Kasper Laudrup <laud...@stacktrace.dk> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/385DF731-B00F-4255-812C-27319239EF33%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist Error on deploying

2018-01-13 Thread 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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/2d02cda2-6678-607a-87c0-d8a862a35ecd%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


TemplateDoesNotExist Error on deploying

2018-01-13 Thread 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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/5078f6e6-1c01-450d-8933-e8abb5632aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Django TemplateDoesNotExist.

2017-11-18 Thread Mike Dewhirst

On 19/11/2017 4:55 AM, jamesmarcusdavy7 wrote:
Hello, am using django 1.11.7 with python 2.7.13.But i have a problem 
when trying to load my page,the page gives me this error



  TemplateDoesNotExist at /

base.html
Request Method: GET
Request URL:http://127.0.0.1:8000/
Django Version: 1.11.7
Exception Type: TemplateDoesNotExist
Exception Value:
base.html
Exception Location: 
C:\Users\JEMO.JAMES\Desktop\marcus\lib\site-packages\django\template\loader.py 
in get_template, line 25

Python Executable:  C:\Users\JEMO.JAMES\Desktop\marcus\Scripts\python.exe
Python Version: 2.7.13
Python Path:
['C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\src',
  'C:\\Windows\\SYSTEM32\\python27.zip',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\DLLs',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\plat-win',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\lib-tk',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\Scripts',
  'c:\\python27\\Lib',
  'c:\\python27\\DLLs',
  'c:\\python27\\Lib\\lib-tk',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\site-packages']
Server time:Sat, 18 Nov 2017 17:18:25 +

My template folder is at the same place my manage.py is and in the 
base.py I have specified the Templates DIRS as 
DIRS:[os.path.join(BASE_DIR,'templates)].How can i  solve this problem?


You could try and convert the Windows pathnames from backslashes to 
forward slashes.


DIRS:[os.path.join(BASE_DIR,'templates)].replace('\\', '/'),

My own Windows equivalent is ...

TEMPLATES = [ { 'BACKEND': 
'django.template.backends.django.DjangoTemplates', 'DIRS': [ 
os.path.join(APPS_ROOT, 'templates/').replace('\\', '/'), ], 'APP_DIRS': 
True, 'OPTIONS': { 'context_processors': [ 
'django.template.context_processors.debug', 
'django.template.context_processors.request', 
'django.contrib.auth.context_processors.auth', 
'django.template.context_processors.i18n', 
'django.template.context_processors.media', 
'django.template.context_processors.static', 
'django.template.context_processors.tz', 
'django.contrib.messages.context_processors.messages', ], }, }, ]






--
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 post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com?utm_medium=email_source=footer>.

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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/fd4e955a-1819-6346-da96-b74edf33e440%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Django TemplateDoesNotExist.

2017-11-18 Thread 'Amitesh Sahay' via Django users
Hi,
1) Its pretty obvious that the django is not able to find the required file in 
the given file path, so please it. 
2) As far as I know, the django 1.11 is supported by Python 3.6. So,  I would 
recommend you to go through the release notes of the 1.11 and use the 
recommended system configuration, otherwise if you put the code in prod env 
things may go hey-wire. For your confirmation, please take 2nd opinion on this 
part before you take any decision. 

Sent from Yahoo Mail on Android 
 
  On Sat, Nov 18, 2017 at 23:26, jamesmarcusdavy7<jamesmarcusda...@gmail.com> 
wrote:   Hello, am using django 1.11.7 with python 2.7.13.But i have a problem 
when trying to load my page,the page gives me this error 

TemplateDoesNotExist at /
 base.html 
| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/ |
| Django Version: | 1.11.7 |
| Exception Type: | TemplateDoesNotExist |
| Exception Value: | base.html |
| Exception Location: | 
C:\Users\JEMO.JAMES\Desktop\marcus\lib\site-packages\django\template\loader.py 
in get_template, line 25 |
| Python Executable: | C:\Users\JEMO.JAMES\Desktop\marcus\Scripts\python.exe |
| Python Version: | 2.7.13 |
| Python Path: | ['C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\src',
 'C:\\Windows\\SYSTEM32\\python27.zip',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\DLLs',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\plat-win',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\Scripts',
 'c:\\python27\\Lib',
 'c:\\python27\\DLLs',
 'c:\\python27\\Lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\site-packages'] |
| Server time: | Sat, 18 Nov 2017 17:18:25 + |

My template folder is at the same place my manage.py is and in the base.py I 
have specified the Templates DIRS as 
DIRS:[os.path.join(BASE_DIR,'templates)].How can i  solve this problem?



-- 
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 post to this group, send email to django-users@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/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/99380856.1142316.1511031057170%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


Problem with Django TemplateDoesNotExist.

2017-11-18 Thread jamesmarcusdavy7
Hello, am using django 1.11.7 with python 2.7.13.But i have a problem when 
trying to load my page,the page gives me this error 
TemplateDoesNotExist at / 

base.html

Request Method: GET 
Request URL: http://127.0.0.1:8000/ 
Django Version: 1.11.7 
Exception Type: TemplateDoesNotExist 
Exception Value: 

base.html

Exception Location: 
C:\Users\JEMO.JAMES\Desktop\marcus\lib\site-packages\django\template\loader.py 
in get_template, line 25 
Python Executable: C:\Users\JEMO.JAMES\Desktop\marcus\Scripts\python.exe 
Python Version: 2.7.13 
Python Path: 

['C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\src',
 'C:\\Windows\\SYSTEM32\\python27.zip',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\DLLs',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\plat-win',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\Scripts',
 'c:\\python27\\Lib',
 'c:\\python27\\DLLs',
 'c:\\python27\\Lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\site-packages']

Server time: Sat, 18 Nov 2017 17:18:25 +My template folder is at the 
same place my manage.py is and in the base.py I have specified the 
Templates DIRS as DIRS:[os.path.join(BASE_DIR,'templates)].How can i  solve 
this problem?

-- 
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 post to this group, send email to django-users@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/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist for django-registration (but it does)

2017-05-13 Thread farah_chaaban
Hello i have the same problem. please help me

-- 
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 post to this group, send email to django-users@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/2a204311-cd54-426d-8593-b9e14f1d1319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: "TemplateDoesNotExist at /"

2017-02-25 Thread Michal Petrucha
On Sat, Feb 25, 2017 at 01:20:49PM -0800, Richard Belew wrote:
> "TemplateDoesNotExist at /"
> 
> (full trace log at http://dpaste.com/3XZ8H3C)
> 
> this must be near the top of django newby issues, but i'm stumped
> on the simplest example i can generate:
> 
> i've used the `settings.TEMPLATES.DIRS` variable to specify a
> shared templates directory (also to simplify things), and
> am using an application's `views.py` file to anchor a
> named url, but the django engine still cannot find the `index.html` file
> i've put there.
> 
> what am i missing?  any hints appreciated,  Rik

[...]

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

This appears to be the incorrect line – here, you set 'DIRS' to a list
containing a single item, which is a tuple containing a path. The
problem is that you wrap the path twice. Django only expects a simple
list of paths, so if you just drop the tuple wrapping the path, you
should be fine::

'DIRS': [os.path.join(BASE_DIR, 'templates')],

> * djggApp/views.py
> 
>def index(request):
> template = loader.get_template('index.html')
> context = Context({})
> return HttpResponse(template.render(context))

This is not strictly related to your problem, but I would strongly
advise not to render templates used as HTTP responses in this way.
Instead, you should be using either the render shortcut [1], or
TemplateResponse [2]. They are mostly equivalent, and both accomplish
the same thing as the above code, only with a single function call.
More often than not, less code is better.

Also, unlike TemplateResponse and render, the code above will not
apply context processors, unless you change that Context to a
RequestContext, which is something that's super easy to forget, and
I've actually seen people get bitten by that in the past, and spend a
lot of time trying to figure out why their templates are not behaving.

Cheers,

Michal

[1]: https://docs.djangoproject.com/en/1.10/topics/http/shortcuts/#render
[2]: 
https://docs.djangoproject.com/en/1.10/ref/template-response/#templateresponse-objects

-- 
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 post to this group, send email to django-users@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/20170225222908.GW23772%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: "TemplateDoesNotExist at /"

2017-02-25 Thread Richard Belew
wow, very good and thank you!it was this mal-formed line:

 
   'DIRS': [ ( os.path.join(BASE_DIR, 'templates'), ) ],


which should have been:

'DIRS': [ os.path.join(BASE_DIR, 'templates'),  ],

i had an extra set of parentheses, for whatever bad reason.  thanks again!

On Saturday, February 25, 2017 at 2:08:21 PM UTC-8, ludovic coues wrote:
>
> yep, look like your settings are wrong 
> try to add that at the end of your settings.py and watch the console 
> you are using to launch django 
>
> print(TEMPLATES["DIRS"]) 
> print(BASE_DIR) 
>
> 2017-02-25 23:05 GMT+01:00 Richard Belew : 
>
> > another possibly relevant bit:  the Template-loader postmortem shows: 
> > 
> >> Django tried loading these templates, in this order: 
> >> 
> >> Using engine django: 
> >> 
> >> django.template.loaders.filesystem.Loader: 
> >> 
> /Data/virtualenv/django/djggProj/('/Data/virtualenv/django/djggProj/templates',)/index.html
>  
>
> >> (Source does not exist) 
> > 
> > 
> > this error message has a badly formed path 
> > 
> "/Data/virtualenv/django/djggProj/('/Data/virtualenv/django/djggProj/templates',)/index.html"
>  
>
> > ; should i care? 
> > 
> > -- 
> > 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. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/8fbefe48-945d-4f4a-9629-d8e59dfd23af%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
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 post to this group, send email to django-users@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/0208c448-b9e6-42ef-a460-628ba036a972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: "TemplateDoesNotExist at /"

2017-02-25 Thread ludovic coues
yep, look like your settings are wrong
try to add that at the end of your settings.py and watch the console
you are using to launch django

print(TEMPLATES["DIRS"])
print(BASE_DIR)

2017-02-25 23:05 GMT+01:00 Richard Belew :
> another possibly relevant bit:  the Template-loader postmortem shows:
>
>> Django tried loading these templates, in this order:
>>
>> Using engine django:
>>
>> django.template.loaders.filesystem.Loader:
>> /Data/virtualenv/django/djggProj/('/Data/virtualenv/django/djggProj/templates',)/index.html
>> (Source does not exist)
>
>
> this error message has a badly formed path
> "/Data/virtualenv/django/djggProj/('/Data/virtualenv/django/djggProj/templates',)/index.html"
> ; should i care?
>
> --
> 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 post to this group, send email to django-users@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/8fbefe48-945d-4f4a-9629-d8e59dfd23af%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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 post to this group, send email to django-users@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/CAEuG%2BTYmLgAmvV2hRsMfn4MAw-AyqT1R-H4JfNKOTpQhOBcJOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: "TemplateDoesNotExist at /"

2017-02-25 Thread Richard Belew
another possibly relevant bit:  the Template-loader postmortem shows:

Django tried loading these templates, in this order:
>
> Using engine django:
>
>- django.template.loaders.filesystem.Loader: 
>
> /Data/virtualenv/django/djggProj/('/Data/virtualenv/django/djggProj/templates',)/index.html
>  
>(Source does not exist)
>
>
this error message has a badly formed path 
"/Data/virtualenv/django/djggProj/('/Data/virtualenv/django/djggProj/templates',)/index.html"
 
; should i care?

-- 
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 post to this group, send email to django-users@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/8fbefe48-945d-4f4a-9629-d8e59dfd23af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"TemplateDoesNotExist at /"

2017-02-25 Thread Richard Belew
"TemplateDoesNotExist at /"

(full trace log at http://dpaste.com/3XZ8H3C)

this must be near the top of django newby issues, but i'm stumped
on the simplest example i can generate:

i've used the `settings.TEMPLATES.DIRS` variable to specify a
shared templates directory (also to simplify things), and
am using an application's `views.py` file to anchor a
named url, but the django engine still cannot find the `index.html` file
i've put there.

what am i missing?  any hints appreciated,  Rik

.
├── db.sqlite3
├── djggApp
│   ├── __init__.py
│   ├── __init__.pyc
...
│   ├── views.py
│   └── views.pyc
├── djggProj
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
├── manage.py
└── templates
...
├── index.html 
* djggProj/settings.py:
 
   TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',

'DIRS': [ ( os.path.join(BASE_DIR, 'templates'), ) ],

# 'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]


* djggProj/urls.py

  
  from djggApp import views

urlpatterns = [
url(r'^$', views.index, name='index'),
...
url(r'^admin/', admin.site.urls),
]


* djggApp/views.py

   def index(request):
template = loader.get_template('index.html')
context = Context({})
return HttpResponse(template.render(context))




-- 
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 post to this group, send email to django-users@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/9adb4f23-8382-4313-9873-aa13c30a06a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist at/

2016-08-13 Thread Andrew Emory
I figured it out.  Of course, now the form isn't rendering...

But at least Django isn't throwing that error anymore.  for all those who 
are curious, I was one directory shallow on the template file's location. 
 I was telling Django to look in static/templates when I needed to tell it 
to look in static/templates/app_name.

-- 
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 post to this group, send email to django-users@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/851ba28a-6630-413b-9743-673922dc4115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist at/

2016-08-13 Thread Andrew Emory
Actually, its Django 1.9.

-- 
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 post to this group, send email to django-users@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/5ff0c7f7-1ad8-4982-9f0d-6b83b3661660%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TemplateDoesNotExist at/

2016-08-13 Thread Andrew Emory


I am having a problem figuring this out and I think there is something 
wrong with my TEMPLATES dictionary in settings.py.


I have my templates in static/templates/app_name and static is in the same 
directory as my project source.


So I have nested os.path.join and os.path.dirname as follows: 'DIRS': [ 
os.path.join(os.path.dirname(BASE_DIR), 'static', 'templates'),],


Any help would be appreciated. All this came about because I was using a 
separate TEMPLATE_DIRS setting only to find our that was deprecated in 1.8 
(I a using 1.10).  Also, I was unable to fix the problem hard coding the 
location (which I don't want to do anyway).


Thanks so much for any help.

-- 
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 post to this group, send email to django-users@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/e24c5060-2fbb-4467-b8f3-c41e0217bd7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist Again

2015-12-24 Thread cquptzzq
Maybe there is a trouble in settings.py.
Maybe you got a wrong template dirs.
You can try that way.

在 2015年12月21日星期一 UTC+8下午10:06:47,Arindam Pradhan写道:
>
> Hi I am new to django community, I want to file a bug regarding a 
> problem similar to this 
> <http://stackoverflow.com/questions/26604294/django-template-does-not-exist-error-although-it-shows-file-exists>
> .
> Also when I use *render* rather than *render_to_response* in *django 1.8*, 
> I do not get a hint that file_exist when using a form.
> Can't we change the error from *templateDoesNotExist* with something else 
> like *IncorrectTemplate* ... or something else.
> I am new to the community, hence want to know where to file an issue for 
> this or if an issue has been submitted regarding this already. 
>
> Regards,
> Arindam Pradhan
>

-- 
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 post to this group, send email to django-users@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/c490f32d-60b6-4181-99e9-fafde33adcca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist Again

2015-12-21 Thread Tim Graham
Could you check if it's still an issue on Django 1.9? There were several 
improvements to template loading in that release [1]. If it is, could you 
provide a sample project with the exact case to be improved?

[1] 
https://docs.djangoproject.com/en/1.9/releases/1.9/#filesystem-based-template-loaders-catch-more-specific-exceptions

On Monday, December 21, 2015 at 9:06:47 AM UTC-5, Arindam Pradhan wrote:
>
> Hi I am new to django community, I want to file a bug regarding a 
> problem similar to this 
> <http://stackoverflow.com/questions/26604294/django-template-does-not-exist-error-although-it-shows-file-exists>
> .
> Also when I use *render* rather than *render_to_response* in *django 1.8*, 
> I do not get a hint that file_exist when using a form.
> Can't we change the error from *templateDoesNotExist* with something else 
> like *IncorrectTemplate* ... or something else.
> I am new to the community, hence want to know where to file an issue for 
> this or if an issue has been submitted regarding this already. 
>
> Regards,
> Arindam Pradhan
>

-- 
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 post to this group, send email to django-users@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/e048bf90-5b8a-484a-b664-ca921a4ed798%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TemplateDoesNotExist Again

2015-12-21 Thread Arindam Pradhan
Hi I am new to django community, I want to file a bug regarding a 
problem similar to this 
<http://stackoverflow.com/questions/26604294/django-template-does-not-exist-error-although-it-shows-file-exists>
.
Also when I use *render* rather than *render_to_response* in *django 1.8*, 
I do not get a hint that file_exist when using a form.
Can't we change the error from *templateDoesNotExist* with something else 
like *IncorrectTemplate* ... or something else.
I am new to the community, hence want to know where to file an issue for 
this or if an issue has been submitted regarding this already. 

Regards,
Arindam Pradhan

-- 
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 post to this group, send email to django-users@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/63eb9241-6bcc-451c-897c-1982cc5d6948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TemplateDoesNotExist: first/test.html DJango 1.8

2015-11-12 Thread Jose Paul
I am getting several TemplateDoesNotExist .like below .

==
ERROR: test_pickling 
(template_tests.test_response.SimpleTemplateResponseTest)
--
Traceback (most recent call last):
  File 
"C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\test_response.py",
 
line 178, in test_pickling
response.render()
  File "C:\Python27\lib\site-packages\django\template\response.py", line 
158, in render
self.content = self.rendered_content
  File "C:\Python27\lib\site-packages\django\template\response.py", line 
133, in rendered_content
template = self._resolve_template(self.template_name)
  File "C:\Python27\lib\site-packages\django\template\response.py", line 
88, in _resolve_template
new_template = self.resolve_template(template)
  File "C:\Python27\lib\site-packages\django\template\response.py", line 
80, in resolve_template
return loader.get_template(template, using=self.using)
  File "C:\Python27\lib\site-packages\django\template\loader.py", line 46, 
in get_template
raise TemplateDoesNotExist(template_name)
TemplateDoesNotExist: first/test.html

Here is my setting.py ,seems I am missing something here .

BASE_TEST_DIR = os.path.join(BASE_DIR,'tests')

 
TEMPATE_TESTS = os.path.join(BASE_TEST_DIR,'template_tests')
TEMPATE_LODER=os.path.join(BASE_TEST_DIR,'template_loader')
TEMPATE_BACKENDS=os.path.join(BASE_TEST_DIR,'template_backends')
TEST_UTILS=os.path.join(BASE_TEST_DIR,'test_utils')
TEST_CLIENT_REGRESS=os.path.join(BASE_TEST_DIR,'test_client_regress')

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ os.path.join(BASE_TEST_DIR, 'templates'), 
 os.path.join(TEMPATE_BACKENDS, 'templates'),
 os.path.join(TEMPATE_TESTS, 'templates'),
 os.path.join(TEST_UTILS, 'templates'),
 os.path.join(TEST_CLIENT_REGRESS, 'templates'),
 os.path.join(TEMPATE_LODER, 'templates'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
],
},
},
]


I can see the " templates" folder in  following path .Following variables 
are initialized correctly .
All these folders have " templates" folder .
 
TEMPATE_TESTS = os.path.join(BASE_TEST_DIR,'template_tests')
TEMPATE_LODER=os.path.join(BASE_TEST_DIR,'template_loader')
TEMPATE_BACKENDS=os.path.join(BASE_TEST_DIR,'template_backends')
TEST_UTILS=os.path.join(BASE_TEST_DIR,'test_utils')
TEST_CLIENT_REGRESS=os.path.join(BASE_TEST_DIR,'test_client_regress')

Please help 


-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08d6c2fe-c8be-465c-9fba-e93b105d1ef7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist at / Error WIth Django 1.8.4 (URGENT)

2015-10-06 Thread ABHIJIT PATKAR
Keep the template folder into your app folder and try it again.

--Abhijit Patkar

On Tue, Oct 6, 2015 at 10:27 AM, Lachlan Musicman  wrote:

> do you have a template in a directory called templates? That directory
> should be at the same level as manage.py
> --
> The most dangerous phrase in the language is, "We've always done it this
> way."
>
> - Grace Hopper
>
>
> On 6 October 2015 at 15:54, dannette opot  wrote:
> > I get the above error when I try to access the login.html.
> >
> > Attached are my application files.
> >
> > --
> > 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 post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/18ea34ec-42ae-4630-af2d-529e00e538ee%40googlegroups.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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGBeqiOzND8XkB%3DAhAixMpN2HzBUf6s57FB7H4Mgn7Kh%2BrZKGQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 








Regards,
Abhijit patkar

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


Re: TemplateDoesNotExist at / Error WIth Django 1.8.4 (URGENT)

2015-10-06 Thread Nelson Varela
Did you notice the name of your template? It says login.html.html


On Tuesday, October 6, 2015 at 12:23:45 PM UTC+2, dannette opot wrote:
>
> I get the above error when I try to access the login.html.
>
> Attached are my application files.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a72d4f97-d508-454d-a918-a85558e2c03e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist at / Error WIth Django 1.8.4 (URGENT)

2015-10-06 Thread Lachlan Musicman
do you have a template in a directory called templates? That directory
should be at the same level as manage.py
--
The most dangerous phrase in the language is, "We've always done it this way."

- Grace Hopper


On 6 October 2015 at 15:54, dannette opot  wrote:
> I get the above error when I try to access the login.html.
>
> Attached are my application files.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/18ea34ec-42ae-4630-af2d-529e00e538ee%40googlegroups.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiOzND8XkB%3DAhAixMpN2HzBUf6s57FB7H4Mgn7Kh%2BrZKGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist

2015-05-13 Thread Владимир Кубанцев
Hi!

In documentation:
¶  

DIRS

Default:: [] (Empty list)

Directories where the engine should look for template source files, in 
search order.

So Django reads your string as a tuple and tries finds templates in each 
element of tuple.
Try 'DIRS' : ['cit/templates']

среда, 13 мая 2015 г., 19:38:18 UTC+3 пользователь Rashmi Ranjan Kar 
написал:
>
> Hi
>
> Please go through the attachment. It contains settings.py, urls.py and 
> localhost:8080 page. kindly help me to solve this issue as soon as possible
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7300ccec-6ad4-4519-afe1-91db4f92f893%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist

2015-05-13 Thread Tim Graham
In what directory is the index.html template you expect to be loaded 
located?

On Wednesday, May 13, 2015 at 12:38:18 PM UTC-4, Rashmi Ranjan Kar wrote:
>
> Hi
>
> Please go through the attachment. It contains settings.py, urls.py and 
> localhost:8080 page. kindly help me to solve this issue as soon as possible
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1eb4fd5d-9b5b-4b5c-a268-4ad16e330a0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: TemplateDoesNotExist

2015-05-13 Thread Stephen J. Butler
See where it says "Django tried loading these templates, in this
order"? Move your index.html template to the appropriate place.

On Wed, May 13, 2015 at 11:12 AM, Rashmi Ranjan Kar  wrote:
> Hi
>
> Please go through the attachment. It contains settings.py, urls.py and
> localhost:8080 page. kindly help me to solve this issue as soon as possible
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4b739804-3913-4467-8cb9-45c1bcbb6ddf%40googlegroups.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD4ANxWrxfM-vRWxxQA%2B0PRHZq0rWOBabruToKY6UdNbBtZ%2BkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Stuck with TemplateDoesNotExist at /

2013-09-02 Thread vogernewsletters
Well, this is embarrassing but the file wasn't in the path after all. A 
simple ls would reveal that. It was one level higher than that.

So I moved the directory templates inside the microblog and now it works.

On 09/02/2013 04:07 PM, Sandro Dutra wrote:
Django cannot load the template, probably the path is wrong, try to 
put this in your settings:


TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), '..', 
'templates').replace('\\','/'),)


About the views, I think you don't need to code it if in your urls.py 
you already used the TemplateView.as_view



2013/9/2 vogernewsletters <vogernewslett...@yahoo.gr 
<mailto:vogernewslett...@yahoo.gr>>


Hi I am new to both Python and Django. I am studying various
tutorials and now I am following the tutorial from
http://gettingstartedwithdjango.com
<http://gettingstartedwithdjango.com/> where the author walks
through the creation of a simple microblog.

I tried to follow the tutorial to the point but I keep getting
TemplateDoesNotExist at /. Then I tried to modify few things but
still I keep getting the error. Right now the configuration is
like this.

My project tree:

microblog/
├── manage.py
├── microblog
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings
│   │   ├── base.py
│   │   ├── base.pyc
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── local.py
│   │   └── local.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── views.py
│   ├── wsgi.py
│   └── wsgi.pyc
├── requirements.txt
└── templates
├── 500.html
└── index.html

My settings/base.py which is essentially equivalent to settings.py
import os
...

PROJECT_ROOT =
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
...
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
)
...
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, 'templates'),
)

My urls.py

from django.views.generic import TemplateView
...
urlpatterns = patterns('',

...
url(r'^$', TemplateView.as_view(template_name="index.html")),
...
)

and I added a views.py just in case
from django.views.generic import TemplateView

class HomepageView(TemplateView):
template_name = "index.html"

Always I get the error message "TemplateDoesNotExist at /"


Django tried loading these templates, in this order:

  * Using loader|django.template.loaders.filesystem.Loader|:
  o 
|/home/voger/PycharmProjects/microblog/microblog/templates/index.html|(File
does not exist)
  * Using loader|django.template.loaders.app_directories.Loader|:
  o 
|/home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/auth/templates/index.html|(File
does not exist)
  o 
|/home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/admin/templates/index.html|(File
does not exist)
  * Using loader|django.template.loaders.eggs.Loader|:

If it would try the first two lines the file is sitting right
there so what is wrong with it?


-- 
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%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Stuck with TemplateDoesNotExist at /

2013-09-02 Thread Sandro Dutra
Django cannot load the template, probably the path is wrong, try to put
this in your settings:

TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), '..',
'templates').replace('\\','/'),)

About the views, I think you don't need to code it if in your urls.py you
already used the TemplateView.as_view


2013/9/2 vogernewsletters <vogernewslett...@yahoo.gr>

>  Hi I am new to both Python and Django. I am studying various tutorials
> and now I am following the tutorial from
> http://gettingstartedwithdjango.com where the author walks through the
> creation of a simple microblog.
>
> I tried to follow the tutorial to the point but I keep getting
> TemplateDoesNotExist at /. Then I tried to modify few things but still I
> keep getting the error. Right now the configuration is like this.
>
> My project tree:
>
> microblog/
> ├── manage.py
> ├── microblog
> │   ├── __init__.py
> │   ├── __init__.pyc
> │   ├── settings
> │   │   ├── base.py
> │   │   ├── base.pyc
> │   │   ├── __init__.py
> │   │   ├── __init__.pyc
> │   │   ├── local.py
> │   │   └── local.pyc
> │   ├── urls.py
> │   ├── urls.pyc
> │   ├── views.py
> │   ├── wsgi.py
> │   └── wsgi.pyc
> ├── requirements.txt
> └── templates
> ├── 500.html
> └── index.html
>
> My settings/base.py which is essentially equivalent to settings.py
> import os
> ...
>
> PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> ...
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> 'django.template.loaders.eggs.Loader',
> )
> ...
> TEMPLATE_DIRS = (
> os.path.join(PROJECT_ROOT, 'templates'),
> )
>
> My urls.py
>
> from django.views.generic import TemplateView
> ...
> urlpatterns = patterns('',
>
> ...
> url(r'^$', TemplateView.as_view(template_name="index.html")),
> ...
> )
>
> and I added a views.py just in case
> from django.views.generic import TemplateView
>
> class HomepageView(TemplateView):
> template_name = "index.html"
>
> Always I get the error message "TemplateDoesNotExist at /"
>
>
>  Django tried loading these templates, in this order:
>
> - Using loader django.template.loaders.filesystem.Loader:
>   -
>   /home/voger/PycharmProjects/microblog/microblog/templates/index.html
>(File does not exist)
> - Using loader django.template.loaders.app_directories.Loader:
>   -
>   
> /home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/auth/templates/index.html
>(File does not exist)
>   -
>   
> /home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/admin/templates/index.html
>(File does not exist)
> - Using loader django.template.loaders.eggs.Loader:
>
> If it would try the first two lines the file is sitting right there so
> what is wrong with it?
>
>  --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Stuck with TemplateDoesNotExist at /

2013-09-02 Thread vogernewsletters
Hi I am new to both Python and Django. I am studying various tutorials 
and now I am following the tutorial from 
http://gettingstartedwithdjango.com 
<http://gettingstartedwithdjango.com/> where the author walks through 
the creation of a simple microblog.


I tried to follow the tutorial to the point but I keep getting 
TemplateDoesNotExist at /. Then I tried to modify few things but still I 
keep getting the error. Right now the configuration is like this.


My project tree:
microblog/
??? manage.py
??? microblog
?   ??? __init__.py
?   ??? __init__.pyc
?   ??? settings
?   ?   ??? base.py
?   ?   ??? base.pyc
?   ?   ??? __init__.py
?   ?   ??? __init__.pyc
?   ?   ??? local.py
?   ?   ??? local.pyc
?   ??? urls.py
?   ??? urls.pyc
?   ??? views.py
?   ??? wsgi.py
?   ??? wsgi.pyc
??? requirements.txt
??? templates
??? 500.html
??? index.html

My settings/base.py which is essentially equivalent to settings.py
import os
...
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
...
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
)
...
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, 'templates'),
)

My urls.py

from django.views.generic import TemplateView
...
urlpatterns = patterns('',
...
url(r'^$', TemplateView.as_view(template_name="index.html")),
...
)

and I added a views.py just in case
from django.views.generic import TemplateView

class HomepageView(TemplateView):
template_name = "index.html"

Always I get the error message "TemplateDoesNotExist at /"

Django tried loading these templates, in this order:

 * Using loader|django.template.loaders.filesystem.Loader|:
 o 
|/home/voger/PycharmProjects/microblog/microblog/templates/index.html|(File
   does not exist)
 * Using loader|django.template.loaders.app_directories.Loader|:
 o 
|/home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/auth/templates/index.html|(File
   does not exist)
 o 
|/home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/admin/templates/index.html|(File
   does not exist)
 * Using loader|django.template.loaders.eggs.Loader|:

If it would try the first two lines the file is sitting right there so 
what is wrong with it?



--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Stuck with TemplateDoesNotExist at /

2013-09-02 Thread Voyager
Hi, I am total newbie when it comes to both Python and Django. I followed 
few tutorials but still can't get things to click at all. Now I am trying 
to follow the tutorial from http://gettingstartedwithdjango.com. I use 
PyCharm as an ide and generated from there the starting project. My problem 
is that no matter what I do I always get an error 
"TemplateDoesNotExist at /"

I began following the tutorial to the point but trying to overcome the 
problem I did a few changes. Right now I have a folder structure like this:

microblog/
├── manage.py
├── microblog
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings
│   │   ├── base.py
│   │   ├── base.pyc
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── local.py
│   │   └── local.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── views.py
│   ├── wsgi.py
│   └── wsgi.pyc
├── requirements.txt
└── templates
├── 500.html
└── index.html

In my base.py which is equivalent to settings.py I have 


import os
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 
...
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
)
...
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, 'templates'),
)

In my urls.py
from django.views.generic import TemplateView
...
  url(r'^$', TemplateView.as_view(template_name="index.html")),

and my views.py:

from django.views.generic import TemplateView


class HomepageView(TemplateView):
template_name = "index.html"

But still when I run the runserver from PyCharm or from command line I 
still get

Django tried loading these templates, in this order:

   - Using loader django.template.loaders.filesystem.Loader:
  - /home/voger/PycharmProjects/microblog/microblog/templates/index.html 
(File 
  does not exist)   < This one I am sure it does
   - Using loader django.template.loaders.app_directories.Loader:
  - 
  
/home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/auth/templates/index.html
 (File 
  does not exist)
  - 
  
/home/voger/blog-venv/lib/python2.7/site-packages/django/contrib/admin/templates/index.html
 (File 
  does not exist)
   - Using loader django.template.loaders.eggs.Loader:

 
Can you please help me figure what is 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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: TemplateDoesNotExist Error...

2012-11-19 Thread rmschne
Yes, with guidance from Django/Python, I am sure the error occurs there. 
Django/Pythyon presents the trace and the line number which causes the 
exception is reported to the command Line.  However, I will look again at 
that line and all lines above.

Yes, I know there is a "good" chance as the clue is that is what the error 
message says. However, the fact is the file does exist. I've used 
copy/paste to test using "ls" the existence of both the Template folder and 
the file.  "ls" can find it. OSX's Finder can find it.  It's there.

If I comment out this part of the code, the next section which works on 
another template located in the same folder also fails.  Oddly, the first 
set of commands working on a template in the same folder works.  It's just 
the "next" one.

As mentioned, a web server is not involved, so not sure how to use the 
LOGGING variable.  I will look again.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/6sZCWEER1icJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesNotExist Error...

2012-11-19 Thread Chris Cogdon
If you're sure your error appears at the "txt=" line, look at the 
definition for that template. There is a good chance it's trying to pull in 
a template (via an include, or a extends) that doesn't exist.

If you need more debugging, you can always modify the LOGGING variable to 
drop a bunch of logging into a file onto the web server.


On Monday, November 19, 2012 3:12:56 PM UTC-6, rmschne wrote:
>
> I have moved to a new laptop which is both my development and production 
> platform. The only change in infrastructure is that I run Python, Django, 
> and all else in a virtual environment (VirtualEnv).  
>
> I am not using Django to run on a web server.  
>
> I have a function which produces a set of HTML files.  The first calls
>
> t=get_template('soc_ad_host_and_guest_list.html')  
> txt=smart_str(t.render(Context({ ... more stuff })))
>
> and the above works fine.
>
> On the second call to a different template which a) does exist, and b) is 
> in the template folder defined by TEMPLATE_DIRS,
>
>  t=get_template('soc_ad_table_guest_list_for_prog.html')
>  txt=smart_str(t.render(Context({'host_list': hostlist,})))and at the 
> statement txt= I get the Django Error: TemplateDoesNotExist
>
> Since I'm not on a web server I can't see the so-called "post mortem" 
> message.  But the template files 'soc_ad_table_guest_list_for_prog.html' 
> does indeed exist, its permissions are 770 (same as the first template that 
> does work).
>
> Suggestions? Any more debugging I can turn on?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/D-DylhqNxtkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TemplateDoesNotExist Error...

2012-11-19 Thread rmschne
 

I have moved to a new laptop which is both my development and production 
platform. The only change in infrastructure is that I run Python, Django, 
and all else in a virtual environment (VirtualEnv).  

I am not using Django to run on a web server.  

I have a function which produces a set of HTML files.  The first calls

t=get_template('soc_ad_host_and_guest_list.html')  
txt=smart_str(t.render(Context({ ... more stuff })))

and the above works fine.

On the second call to a different template which a) does exist, and b) is 
in the template folder defined by TEMPLATE_DIRS,

 t=get_template('soc_ad_table_guest_list_for_prog.html')
 txt=smart_str(t.render(Context({'host_list': hostlist,})))and at the 
statement txt= I get the Django Error: TemplateDoesNotExist

Since I'm not on a web server I can't see the so-called "post mortem" 
message.  But the template files 'soc_ad_table_guest_list_for_prog.html' 
does indeed exist, its permissions are 770 (same as the first template that 
does work).

Suggestions? Any more debugging I can turn on?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DmbpfR4nokgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: All of the sudden getting TemplateDoesNotExist error

2012-07-25 Thread rmschne
Karen,

All sorted now.

Thanks!  Well (tail between legs), the problem was not the template that 
was being called, but a template being "included" inside that template. 
 That second template is loaded based on a few "if" statements, and a 
bug/flaw in my logic (undetected until now ... code in place for months), 
failed to load a valid template file.  Didn't get error messages (no access 
to "post mortem" page as I don't run the app on a web servrer) sufficient 
to point me to the real cause and I was chasing red herrings for a while.

Message for others:  when in similar circumstances, look for issues not 
only with the first-called template, but any templates "included".

Re "alpha" ... well, simple inertial.  The Django stuff I do is not on a 
web server but on my PC.  I use Django to construct static HTM files, and 
other things, from content held in the database. I simply copy the HTM 
files to the server on change.  Sort of taking the approach "it works, 
don't break it on purpose".  I'll do an upgrade to current version this 
week.  

On Wednesday, 25 July 2012 02:33:17 UTC+1, Karen Tracey wrote:
>
> On Tue, Jul 24, 2012 at 11:41 AM, rmschne  wrote:
>
>> I have made no changes to settings.py. Honest.  I'm running Django 1.4.0 
>> alpha.
>
>
> Why alpha rather than the released version? Not that I think it has 
> anything to do with the problem, it just seems odd to stick with an alpha 
> level after the official release is available.
>
>  
>
>> The variable TEMPLATE_DIRS is pointing to a folder which exists and the 
>> template 'directory.html' i wish to load in in that 
>> folder, /Users/rmschne/Documents/source/django/projects/socmgmt/templates/. 
>>  My ID has appropriate permissions (running on Mac OS/X). 
>>
>> All of the sudden today (and it worked  a few days ago), I get 
>> "TemplateDoesNotExist" error.  This happens for any of the templates I try 
>> to load.
>>
>> Frankly, I'm at a kinda loss as to where to start debugging this since 
>> everything looks ok and I don't recall making any changes that would be 
>> relevants.
>>
>>
> With DEBUG on the template loader post mortem on the debug page should 
> give some clues.  What does it say?
>
> Karen
> -- 
> http://tracey.org/kmt/
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/sY0WOaRGJzAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: All of the sudden getting TemplateDoesNotExist error

2012-07-24 Thread Karen Tracey
On Tue, Jul 24, 2012 at 11:41 AM, rmschne <rmsc...@gmail.com> wrote:

> I have made no changes to settings.py. Honest.  I'm running Django 1.4.0
> alpha.


Why alpha rather than the released version? Not that I think it has
anything to do with the problem, it just seems odd to stick with an alpha
level after the official release is available.



> The variable TEMPLATE_DIRS is pointing to a folder which exists and the
> template 'directory.html' i wish to load in in that
> folder, /Users/rmschne/Documents/source/django/projects/socmgmt/templates/.
>  My ID has appropriate permissions (running on Mac OS/X).
>
> All of the sudden today (and it worked  a few days ago), I get
> "TemplateDoesNotExist" error.  This happens for any of the templates I try
> to load.
>
> Frankly, I'm at a kinda loss as to where to start debugging this since
> everything looks ok and I don't recall making any changes that would be
> relevants.
>
>
With DEBUG on the template loader post mortem on the debug page should give
some clues.  What does it say?

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



All of the sudden getting TemplateDoesNotExist error

2012-07-24 Thread rmschne
I have made no changes to settings.py. Honest.  I'm running Django 1.4.0 
alpha. The variable TEMPLATE_DIRS is pointing to a folder which exists and 
the template 'directory.html' i wish to load in in that 
folder, /Users/rmschne/Documents/source/django/projects/socmgmt/templates/. 
 My ID has appropriate permissions (running on Mac OS/X). 

All of the sudden today (and it worked  a few days ago), I get 
"TemplateDoesNotExist" error.  This happens for any of the templates I try 
to load.

Frankly, I'm at a kinda loss as to where to start debugging this since 
everything looks ok and I don't recall making any changes that would be 
relevants.

Thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/YogUO9twskIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django 1.4 - admin TemplateDoesNotExist at /admin/auth/user/

2012-05-12 Thread Josh J
Hi,

We recently upgraded from django 1.3 to django 1.4. I updated the manage.py
and am also using the wsgi.py as recommended in the release notes. We
deploy to apache using mod_wsgi on our servers and use manage.py runserver
locally.

Locally we get errors when trying to render the admin pages. However on
apache using mod_wsgi the admin pages work. Any ideas?



The errors are
TemplateDoesNotExist at /admin/auth/user/

admin/auth/user/change_list.html, admin/auth/change_list.html,
admin/change_list.html


Request Method:GETRequest URL:http://localhost:8000/admin/auth/user/Django
Version:1.4Exception Type:TemplateDoesNotExistException Value:

admin/auth/user/change_list.html, admin/auth/change_list.html,
admin/change_list.html




Template-loader postmortem

Django tried loading these templates, in this order:

   - Using loader django.template.loaders.filesystem.Loader:
  - 
/media/data/work/clean/rmsagit/customers/templates/admin/auth/user/change_list.html,
  admin/auth/change_list.html, admin/change_list.html (File does not
  exist)
   - Using loader django.template.loaders.app_directories.Loader:
  - 
/media/data/work/clean/rmsagit/customers/templates/admin/auth/user/change_list.html,
  admin/auth/change_list.html, admin/change_list.html (File does not
  exist)




Thanks,
Josh

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesnotExist: 500.html

2012-04-02 Thread FraMazz
If you need to know what goes in the 500 template have a look at: 
http://www.djangobook.com/en/2.0/chapter12/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/37kP93U2aGoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesnotExist: 500.html

2012-03-31 Thread Gabriel .
On Sat, Mar 31, 2012 at 5:03 PM, Pals  wrote:
>  I am a novice programmer who just started to learn Django.. I could
> not figure out the error related to 500.html. In fact, I would be
> grateful if someone guides me making 500.html file. I am using mac
> osx, Python 2.7 and Django 1.4.
>

https://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TemplateDoesnotExist: 500.html

2012-03-31 Thread Pals
 I am a novice programmer who just started to learn Django.. I could
not figure out the error related to 500.html. In fact, I would be
grateful if someone guides me making 500.html file. I am using mac
osx, Python 2.7 and Django 1.4.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Keep getting TemplateDoesNotExist when unit testing

2012-03-03 Thread Calvin Cheng

Hi Jonas,

I am having exactly the same problem in one of my projects and I am not 
sure why.  Did you manage to solve it in the end?

Would appreciate it if you could share with me your solution if you did.

Regards,
Calvin


On Saturday, December 24, 2011 10:51:27 PM UTC+8, jonas wrote:
>
> Hello,
>
> I'm fairly new to Unit Testing.
>
> As I'm trying to setup a simple unit test in one of my Projects,
> it keeps returning a TemplateDoesNotExist Exception.
>
> It looks like for some reason the unit test framework can't locate my 
> template directory I've correctly defined in settings.py
>
> Here's the traceback:
>
> ==
> ERROR: test_url (gig.tests.GigURLTest)
> --
> Traceback (most recent call last):
>   File "/home/jonasg/dev/wiespeeltwaar/gig/tests.py", line 14, in test_url
> response = c.get('/')
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/test/client.py",
>  
> line 445, in get
> response = super(Client, self).get(path, data=data, **extra)
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/test/client.py",
>  
> line 229, in get
> return self.request(**r)
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/core/handlers/base.py",
>  
> line 111, in get_response
> response = callback(request, *callback_args, **callback_kwargs)
>   File "/home/jonasg/dev/wiespeeltwaar/../wiespeeltwaar/gig/views.py", 
> line 74, in index
> http_res = render_to_response('gig/index.html', c , 
> context_instance=RequestContext(request))
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/shortcuts/__init__.py",
>  
> line 20, in render_to_response
> return HttpResponse(loader.render_to_string(*args, **kwargs), 
> **httpresponse_kwargs)
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
>  
> line 181, in render_to_string
> t = get_template(template_name)
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
>  
> line 157, in get_template
> template, origin = find_template(template_name)
>   File 
> "/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
>  
> line 138, in find_template
> raise TemplateDoesNotExist(name)
> TemplateDoesNotExist: gig/index.html
>
>
> The unit test itself is simple:
>
> from django.test import TestCase
> from django.test.client import Client
>
> class GigURLTest(TestCase):
> def test_url(self):
> c = Client()
> response = c.get('/')
> self.assertEqual(response.status_code, 200)   
> 
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/kvcalsd1X_UJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Keep getting TemplateDoesNotExist when unit testing

2011-12-24 Thread Jonas Geiregat
Hello,

I'm fairly new to Unit Testing.

As I'm trying to setup a simple unit test in one of my Projects,
it keeps returning a TemplateDoesNotExist Exception.

It looks like for some reason the unit test framework can't locate my template 
directory I've correctly defined in settings.py

Here's the traceback:

==
ERROR: test_url (gig.tests.GigURLTest)
--
Traceback (most recent call last):
  File "/home/jonasg/dev/wiespeeltwaar/gig/tests.py", line 14, in test_url
response = c.get('/')
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/test/client.py",
 line 445, in get
response = super(Client, self).get(path, data=data, **extra)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/test/client.py",
 line 229, in get
return self.request(**r)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/core/handlers/base.py",
 line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
  File "/home/jonasg/dev/wiespeeltwaar/../wiespeeltwaar/gig/views.py", line 74, 
in index
http_res = render_to_response('gig/index.html', c , 
context_instance=RequestContext(request))
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/shortcuts/__init__.py",
 line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), 
**httpresponse_kwargs)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
 line 181, in render_to_string
t = get_template(template_name)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
 line 157, in get_template
template, origin = find_template(template_name)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
 line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: gig/index.html


The unit test itself is simple:

from django.test import TestCase
from django.test.client import Client

class GigURLTest(TestCase):
def test_url(self):
c = Client()
response = c.get('/')
self.assertEqual(response.status_code, 200) 

   

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Keep getting TemplateDoesNotExist when unit testing

2011-12-24 Thread Jonas Geiregat
Hello,

I'm fairly new to Unit Testing.

As I'm trying to setup a simple unit test in one of my Projects,
it keeps returning a TemplateDoesNotExist Exception.

It looks like for some reason the unit test framework can't locate my template 
directory I've correctly defined in settings.py

Here's the traceback:

==
ERROR: test_url (gig.tests.GigURLTest)
--
Traceback (most recent call last):
  File "/home/jonasg/dev/wiespeeltwaar/gig/tests.py", line 14, in test_url
response = c.get('/')
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/test/client.py",
 line 445, in get
response = super(Client, self).get(path, data=data, **extra)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/test/client.py",
 line 229, in get
return self.request(**r)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/core/handlers/base.py",
 line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
  File "/home/jonasg/dev/wiespeeltwaar/../wiespeeltwaar/gig/views.py", line 74, 
in index
http_res = render_to_response('gig/index.html', c , 
context_instance=RequestContext(request))
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/shortcuts/__init__.py",
 line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), 
**httpresponse_kwargs)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
 line 181, in render_to_string
t = get_template(template_name)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
 line 157, in get_template
template, origin = find_template(template_name)
  File 
"/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django/template/loader.py",
 line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: gig/index.html


The unit test itself is simple:

from django.test import TestCase
from django.test.client import Client

class GigURLTest(TestCase):
def test_url(self):
c = Client()
response = c.get('/')
self.assertEqual(response.status_code, 200) 

   

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesNotExist at /search/

2011-12-21 Thread Tebogo Moloi


On Dec 21, 7:18 pm, Tom Evans  wrote:
> On Wed, Dec 21, 2011 at 5:04 PM, Tebogo Moloi  wrote:
> > Hi guys I am getting this error every time i submit the form, when the
> > submit and the field is empty the error message appears, which
> > indicates that django does see the templates which I have set in the
> > settings.
>
> Are you trying to say that if the form is submitted with failures, a
> template is found and rendered, and if it does not have failures,
> there is no template to be found?
>
> Have you invented quantum templates?
>
> More seriously, this sounds like one path through your view code - the
> initial displaying of the form, and redisplaying in case of errors -
> uses one template, and the success path uses a different template.
> In your traceback it is trying to load the template
> 'search_results.html', and it lists a bunch of locations where it is
> looking for that template.
>
> Does a template with that name exist in those locations (django says no)?
> Does your view refer to the wrong template name?
>
> Cheers
>
> Tom

Hi Tom

Thanks for the response, I just realized that search_form.html is the
form that renders the errors and once the query is successful the
should be a second file(search_results.html) which displays results.

Thanks for your help, and you really got me thinking about "Have you
invented quantum templates?" guess I needed that.

Cheers
Tebs

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesNotExist at /search/

2011-12-21 Thread Tom Evans
On Wed, Dec 21, 2011 at 5:04 PM, Tebogo Moloi  wrote:
> Hi guys I am getting this error every time i submit the form, when the
> submit and the field is empty the error message appears, which
> indicates that django does see the templates which I have set in the
> settings.
>

Are you trying to say that if the form is submitted with failures, a
template is found and rendered, and if it does not have failures,
there is no template to be found?

Have you invented quantum templates?

More seriously, this sounds like one path through your view code - the
initial displaying of the form, and redisplaying in case of errors -
uses one template, and the success path uses a different template.
In your traceback it is trying to load the template
'search_results.html', and it lists a bunch of locations where it is
looking for that template.

Does a template with that name exist in those locations (django says no)?
Does your view refer to the wrong template name?

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TemplateDoesNotExist at /search/

2011-12-21 Thread Tebogo Moloi
Hi guys I am getting this error every time i submit the form, when the
submit and the field is empty the error message appears, which
indicates that django does see the templates which I have set in the
settings.

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/search/?q=Pro+.NET+Best+Practices

Django Version: 1.4 pre-alpha SVN-17229
Python Version: 2.7.2
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'projects.polls',
 'projects.books')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/Users/Tebogo/djcode/projects/projects/books/templates/
search_results.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/django/contrib/auth/templates/search_results.html (File does
not exist)
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/django/contrib/admin/templates/search_results.html (File does
not exist)
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/django/contrib/admindocs/templates/search_results.html (File
does not exist)
/Users/Tebogo/djcode/projects/projects/books/templates/
search_results.html (File does not exist)



Traceback:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
site-packages/django/core/handlers/base.py" in get_response
  111. response = callback(request,
*callback_args, **callback_kwargs)
File "/Users/Tebogo/djcode/projects/projects/books/views.py" in search
  18. {'books': books, 'query': q})
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
site-packages/django/shortcuts/__init__.py" in render_to_response
  20. return HttpResponse(loader.render_to_string(*args,
**kwargs), **httpresponse_kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
site-packages/django/template/loader.py" in render_to_string
  169. t = get_template(template_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
site-packages/django/template/loader.py" in get_template
  145. template, origin = find_template(template_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
site-packages/django/template/loader.py" in find_template
  138. raise TemplateDoesNotExist(name)

Exception Type: TemplateDoesNotExist at /search/
Exception Value: search_results.html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Urgent: django app got internal error: TemplateDoesNotExist: 500.html

2011-12-19 Thread huseyin yilmaz
It looks to me like you do not have 500.html file in your base
template directory. If you have a server error in production mode
(DEBUG = False), django will show 500.html to users. So users will not
see actual error message. But you will get that message by email.
Since you do not have 500.html it gives you template does not exist
error instead of actual error message. This will not help you to solve
your problem, but at least it will help you identify it.

On Dec 19, 9:24 pm, Ashkan Roshanayi <ashkan.roshan...@gmail.com>
wrote:
> I tried to live edit base.py template but now my app has internal error. I
> undo the changes but still get 500 error while accessing website. Tail -f
> of my application_name.log shows:
>
>
>
>
>
>
>
>
>
>
>
> >   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> > line 108, in __init__
> >     self.nodelist = compile_string(template_string, origin)
> >   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> > line 136, in compile_string
> >     return parser.parse()
> >   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> > line 237, in parse
> >     self.invalid_block_tag(token, command, parse_until)
> >   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> > line 291, in invalid_block_tag
> >     raise self.error(token, "Invalid block tag: '%s'" % command)
> > TemplateSyntaxError: Invalid block tag: '%20get_static_prefix%20'
>
> And tail -f of error.log shows:
>
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]     return
>
>
>
>
>
>
>
>
>
> > callback(request, **param_dict), referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py",
> > line 93, in _wrapped_view, referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]     response =
> > view_func(request, *args, **kwargs), referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/views/defaults.py",
> > line 30, in server_error, referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]     t =
> > loader.get_template(template_name) # You need to create a 500.html
> > template., referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py",
> > line 157, in get_template, referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]     template,
> > origin = find_template(template_name), referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py",
> > line 138, in find_template, referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]     raise
> > TemplateDoesNotExist(name), referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]
> > TemplateDoesNotExist: 500.html, referer:
> >http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6...
> > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] mod_wsgi
> > (pid=2688): Exception occurred processing WSGI script
> > '/home/jalala/projects/Hamkharid/bin/django.wsgi'.
> > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206] Traceback
> > (most recent call last):
> > [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206]   File
> > "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py",
> > line 272, in __call__
>

Re: Urgent: django app got internal error: TemplateDoesNotExist: 500.html

2011-12-19 Thread Nikolas Stevenson-Molnar
Also, your "undo" may not have been picked up by the app; I would also
try restarting your webserver.

_Nik

On 12/19/2011 11:24 AM, Ashkan Roshanayi wrote:
> I tried to live edit base.py template but now my app has internal
> error. I undo the changes but still get 500 error while accessing
> website. Tail -f of my application_name.log shows:
>
>
>   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> line 108, in __init__
> self.nodelist = compile_string(template_string, origin)
>   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> line 136, in compile_string
> return parser.parse()
>   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> line 237, in parse
> self.invalid_block_tag(token, command, parse_until)
>   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/base.py",
> line 291, in invalid_block_tag
> raise self.error(token, "Invalid block tag: '%s'" % command)
> TemplateSyntaxError: Invalid block tag: '%20get_static_prefix%20'
>
>
> And tail -f of error.log shows:
>
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]
> return callback(request, **param_dict), referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/utils/decorators.py",
> line 93, in _wrapped_view, referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]
> response = view_func(request, *args, **kwargs), referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/views/defaults.py",
> line 30, in server_error, referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121] t
> = loader.get_template(template_name) # You need to create a
> 500.html template., referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py",
> line 157, in get_template, referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]
> template, origin = find_template(template_name), referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/template/loader.py",
> line 138, in find_template, referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]
> raise TemplateDoesNotExist(name), referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:28 2011] [error] [client 188.158.186.121]
> TemplateDoesNotExist: 500.html, referer:
> 
> http://go.madmimi.com/redirects/5e9c3ec9b21e58257eadd15120210f5c?pa=6799748107
> [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206]
> mod_wsgi (pid=2688): Exception occurred processing WSGI script
> '/home/jalala/projects/Hamkharid/bin/django.wsgi'.
> [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206]
> Traceback (most recent call last):
> [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206]   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py",
> line 272, in __call__
> [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206]
> response = self.get_response(request)
> [Mon Dec 19 13:22:55 2011] [error] [client 109.125.144.206]   File
> 
> "/home/jalala/projects/Hamkharid/eggs/Django-1.3.1-py2.7.egg/django/core/handlers/base.py",
> line 169, in get_re

  1   2   3   >