Muflone
that is everything what i got
Fleeing from the error messages won't take you far They are made to be read from you
Charly
that is everything what i got
Do you have a db server running on your localhost?
refleks1a
yes
refleks1a
it is running on localhost: 3306
Muflone
What db is running ? Postgres don't use 3306 usually
Charly
it is running on localhost: 3306
the error is expecting it on 5432, because thats the port of postgresql
Albert
How can I connect my xampo database
refleks1a
i don't know why
Charly
but mine is running on 3306
Thats MySQL not postgres
Muflone
but mine is running on 3306
Answer my question please
refleks1a
I wrote that postgresql is runnig on port 3306
refleks1a
it is
Charly
it is
Is not postgres
Muflone
It's very unlikely you have postgres on 3306 until you tweaked it to run on that port
cj
I wrote that postgresql is runnig on port 3306
are you using docker or something like that?
Charly
are you using docker or something like that?
he said xampo, so I assume is xampp
cj
he said xampo, so I assume is xampp
it's not the same guy...
Lords
It will work but no need for angular
Without frontend how dude
Siddharth
Without frontend how dude
Oh sorry I got confuse haha, I thought you are talking about Node.js, frontend with angular and react is good to go
Farruh Zoirov
Hi everyone
Farruh Zoirov
I need help of django
Doragonsureiyā
I need help of django
No one can help you until you explain your difficulties.
Farruh Zoirov
I have one model in admin and in model have 3 object i am going to draw these information to html file by for loop in django what will i do
Farruh Zoirov
Namely which I need
Charly
I have one model in admin and in model have 3 object i am going to draw these information to html file by for loop in django what will i do
So you need to create a view, a template and a URL You probably want to follow the official tutorial to learn these concepts
Farruh Zoirov
So you need to create a view, a template and a URL You probably want to follow the official tutorial to learn these concepts
I learned however for example I need info of object2 I can't get these information of this object
Farruh Zoirov
{% for obj in objects %} <li> <!-- Display the information of each object --> <h2>Object {{ obj.pk }}</h2> <p>Name: {{ obj.name }}</p> <p>Description: {{ obj.description }}</p> <p>Other Field: {{ obj.other_field }}</p> <hr> </li> {% endfor %}
Farruh Zoirov
in objects I have 3 information of books actually I am going to render all these which I need and I need on place .
Farruh Zoirov
Why not?
can you help me?
Farruh Zoirov
do you have ever faced this problem
Farruh Zoirov
from django.shortcuts import render from django.http import HttpResponse from django.views.generic import TemplateView from .models import Project,BookPrice # from .models import Project from django.views.generic import ListView # Create your views here. from .models import BookPrice class HomePageView(ListView): model = Project class HomePageView(ListView): model = BookPrice template_name = 'index.html'
Charly
do you have ever faced this problem
I don' t understand the issue what part is the one you can' t display?
Alex
I am going to get of model inside of admin panel
You can do that by registering model in admin.py
Alex
I did
And problem?
Farruh Zoirov
And problem?
I have one model filled with 3 data in the model in the admin panel, but I want to render what I need to my html file, for example, object2, that is, my data filled in two
Farruh Zoirov
Hovewer It is not working
Farruh Zoirov
Alex
Yeah
Farruh Zoirov
after that?
Muflone
I learned however for example I need info of object2 I can't get these information of this object
Do you want to render information separately or the second model is related to the objects you're iterating?
Farruh Zoirov
That's right
Muflone
yep
Invalid answer, read the question again
Farruh Zoirov
i can't explain in my opinion
Alex
Can you describe of what you want, what you have done, what is happening in detail?
Muflone
i can't explain in my opinion
There were a OR in the question, so you have to choose between two You can't answer yes to that type of question
Farruh Zoirov
<section class="site-main-tabs__cards"> <div class="site-main-tabs__card site-main-tabs__card--active"> <div class="site-main-tabs__inner"> <img class="site-main-tabs-illustration--bookmark" src="https://assets.asaxiy.uz/product/items/desktop/03f544613917945245041ea1581df0c22021072812454341177sMPHeUQr9N.jpg.webp" width="536px" height="346px"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">${{object.name}}</h2> <!-- <p class="site-main-tabs__text">{{object.bookInfo}}</p> <strong class="site-main-tabs__text">Kitobning narxi: {{ object1.bookPrice}}</strong> --> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> <div class="site-main-tabs__card"> <div class="site-main-tabs__inner"> <img class="site-main-tabs-illustration--search" src="https://assets.asaxiy.uz/product/items/desktop/6e16656a6ee1de7232164767ccfa79202022042720485117146X2bgyDuYei.jpg.webp" width="536px" height="346px" alt="Search image"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">{{object2.bookName}}</h2> <p class="site-main-tabs__text">Kitobning narxi: {{book.bookPrice}}</p> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> <div class="site-main-tabs__card"> <div class="site-main-tabs__inner"> <img style="border-radius: 5px;" class="site-main-tabs-illustration--share" src="https://assets.asaxiy.uz/product/items/desktop/be1bc7997695495f756312886f5661102022042721444072504yCTRpe6uKr.jpg.webp" width="440" height="380" alt="Easy share image"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">{{book.bookName}}</h2> <p class="site-main-tabs__text">Kitobning narxi: {{book.bookPrice}}</p> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> </section>
Doragonsureiyā
<section class="site-main-tabs__cards"> <div class="site-main-tabs__card site-main-tabs__card--active"> <div class="site-main-tabs__inner"> <img class="site-main-tabs-illustration--bookmark" src="https://assets.asaxiy.uz/product/items/desktop/03f544613917945245041ea1581df0c22021072812454341177sMPHeUQr9N.jpg.webp" width="536px" height="346px"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">${{object.name}}</h2> <!-- <p class="site-main-tabs__text">{{object.bookInfo}}</p> <strong class="site-main-tabs__text">Kitobning narxi: {{ object1.bookPrice}}</strong> --> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> <div class="site-main-tabs__card"> <div class="site-main-tabs__inner"> <img class="site-main-tabs-illustration--search" src="https://assets.asaxiy.uz/product/items/desktop/6e16656a6ee1de7232164767ccfa79202022042720485117146X2bgyDuYei.jpg.webp" width="536px" height="346px" alt="Search image"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">{{object2.bookName}}</h2> <p class="site-main-tabs__text">Kitobning narxi: {{book.bookPrice}}</p> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> <div class="site-main-tabs__card"> <div class="site-main-tabs__inner"> <img style="border-radius: 5px;" class="site-main-tabs-illustration--share" src="https://assets.asaxiy.uz/product/items/desktop/be1bc7997695495f756312886f5661102022042721444072504yCTRpe6uKr.jpg.webp" width="440" height="380" alt="Easy share image"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">{{book.bookName}}</h2> <p class="site-main-tabs__text">Kitobning narxi: {{book.bookPrice}}</p> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> </section>
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://hastebin.com - https://nekobin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Farruh Zoirov
<section class="site-main-tabs__cards"> <div class="site-main-tabs__card site-main-tabs__card--active"> <div class="site-main-tabs__inner"> <img class="site-main-tabs-illustration--bookmark" src="https://assets.asaxiy.uz/product/items/desktop/03f544613917945245041ea1581df0c22021072812454341177sMPHeUQr9N.jpg.webp" width="536px" height="346px"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">${{object.name}}</h2> <!-- <p class="site-main-tabs__text">{{object.bookInfo}}</p> <strong class="site-main-tabs__text">Kitobning narxi: {{ object1.bookPrice}}</strong> --> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> <div class="site-main-tabs__card"> <div class="site-main-tabs__inner"> <img class="site-main-tabs-illustration--search" src="https://assets.asaxiy.uz/product/items/desktop/6e16656a6ee1de7232164767ccfa79202022042720485117146X2bgyDuYei.jpg.webp" width="536px" height="346px" alt="Search image"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">{{object2.bookName}}</h2> <p class="site-main-tabs__text">Kitobning narxi: {{book.bookPrice}}</p> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> <div class="site-main-tabs__card"> <div class="site-main-tabs__inner"> <img style="border-radius: 5px;" class="site-main-tabs-illustration--share" src="https://assets.asaxiy.uz/product/items/desktop/be1bc7997695495f756312886f5661102022042721444072504yCTRpe6uKr.jpg.webp" width="440" height="380" alt="Easy share image"> <div class="site-main-tabs__content"> <h2 class="site-main-tabs__title">{{book.bookName}}</h2> <p class="site-main-tabs__text">Kitobning narxi: {{book.bookPrice}}</p> <a class=" site-main-tabs__button site-main-tabs--tstyles button--blue" href="https://t.me/farruh_zoirov"> Sotib olish</a> </div> </div> </div> </section>
Here my html file , and it separated to 3 part and here there are h2, p, I am going to place match information which I need getting my model's data
Muflone
by iteration
There is some language barrier, I think you don't follow the questions posed to you
Farruh Zoirov
Alright, classic X Y problem.
what are X Y problem?
Farruh Zoirov
can I call by id?
Alex
Give me few seconds
Farruh Zoirov
Give me few seconds
ok no problem
Alex
ok no problem
https://pastebin.com/UNnG7Djt Here
Farruh Zoirov
https://pastebin.com/UNnG7Djt Here
Can these codes get all data of model?
Farruh Zoirov
Yeah
It is working
Farruh Zoirov
Thanks everyone
Farruh Zoirov
Especially to you bro
Farruh Zoirov
Actually I am Frontend Developer
Farruh Zoirov
What techstack?
I know html,css,js,bootstrap,sass but I don't know Framework I need to learn