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

Re: How Do I Authorise user using token

2021-10-06 Thread Kasper Laudrup
On 06/10/2021 18.28, Adeyemi Deji wrote: Check this out, might be of help. https://www.youtube.com/watch?v=Wq6JqXqOzCE Adeyemi, it is very much appreciated that you're trying to help, but while top-posting is already extremely annoying, I probably have to accept that. But do please try to

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 Wedn

Re: How Do I Authorise user using token

2021-10-06 Thread Adeyemi Deji
Check this out, might be of help. https://www.youtube.com/watch?v=Wq6JqXqOzCE On Wednesday, October 6, 2021 at 6:16:51 PM UTC+2 Kasper Laudrup wrote: > On 06/10/2021 15.19, M R wrote: > > > > I have created tokens but i don't know how to use it for authentication. > > > https://devinsights.has

Re: How Do I Authorise user using token

2021-10-06 Thread Kasper Laudrup
On 06/10/2021 15.19, M R wrote: I have created tokens  but i don't know how to use it for authentication. https://devinsights.hashnode.dev/token-based-user-authentication-with-django Every web page is showing in postman in google. I have no idea what that is supposed to mean. Please clari

How Do I Authorise user using token

2021-10-06 Thread M R
Hi DRF Team, I have created tokens but i don't know how to use it for authentication. Every web page is showing in postman in google. how do i use headers in url Thanks Madhusudhan -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

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')] > > O

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

Re: Listing and Searching fields in another table

2021-10-06 Thread Derek
Obviously you will be searching in related table. So if you have models.py like: class Author(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) class Book(models.Model): title = models.CharField(max_length=200) author = mod

Re: Django Permission

2021-10-06 Thread Steven Mapes
If you have the code in a file as you have then what's happening is that you trying to create the same Permission everytime Django runs. What you want to do is to create the permission against the BlogPost model itself within the class Meta. Then run a makemigrations and migrate to create the

Re: TemplateDoesNotExist at /catalog/books/

2021-10-06 Thread Adeyemi Deji
correct paginated_by to paginate_by. Virus-free. www.avast.com

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 templat

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_na

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"

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"

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

Re: ModuleNotFoundError: No module named 'tempfile'

2021-10-06 Thread Adeyemi Deji
Oh, I didn't get that talk about tempfile but I do now, thanks. Since installation is the issue, y not delete and reinstall python latest version Virus-free. www.avast.com <

Re: ModuleNotFoundError: No module named 'tempfile'

2021-10-06 Thread Kasper Laudrup
I think you replied to the wrong post here, but anyway: On 06/10/2021 10.57, Adeyemi Deji wrote: First of all, what text editor do you use, If not visual studio code I recommend you get that one and learn how to use it, then u can always set the python interpreter based on your choice. I don'

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 spe

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

Re: Keycloak & Django Setup Error - "UNIQUE constraint failed: auth_user.username" & usernames are being hashed

2021-10-06 Thread Adeyemi Deji
Hi, can you make a snapshot of your models.py file? On Wednesday, October 6, 2021 at 7:26:24 AM UTC+2 abubak...@gmail.com wrote: > you're facing this error because django receives nique usernames. so you > are not allowed to create another username with the same username. > > On Wed, Oct 6, 2021

Re: ModuleNotFoundError: No module named 'tempfile'

2021-10-06 Thread Adeyemi Deji
First of all, what text editor do you use, If not visual studio code I recommend you get that one and learn how to use it, then u can always set the python interpreter based on your choice. Secondly u need a virtual environment and you can get that with (python -m venv venv) then activate it by cha

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 Temp