Jb
please help
Kamlesh
def products(request): product = Product.objects.all() return render(request, 'accounts/products.html', {'products': product})
Kamlesh
Can u pls show products. Html
Jb
Can u pls show products. Html
{% for i in Product %} <tr> <td>{{i.name}}</td> <td>{{i.price}}</td> <td>{{i.category}}</td> <td>{{i.description}}</td> </tr> {% endfor %}
Finding
instead of Product
Finding
{% for i in Product %} <tr> <td>{{i.name}}</td> <td>{{i.price}}</td> <td>{{i.category}}</td> <td>{{i.description}}</td> </tr> {% endfor %}
{% for i in products%} <tr> <td>{{i.name}}</td> <td>{{i.price}}</td> <td>{{i.category}}</td> <td>{{i.description}}</td> </tr> {% endfor %}
Jb
not working
Finding
not working
in the html, change the for statement. use products instead of Product
Anonymous
I am new to this group
Anonymous
I find everywhere but I can't display picture from media
The
does mariadb works for django 3?
The
thanks
Abrar
Product = Product.objects.all() return render(request, 'accounts/products.html', {'products': product})
You have saved the queryset in Priduct but you are sending product to the template.
Abrar
Product = Product.objects.all() return render(request, 'accounts/products.html', {'products': Product})
Abrar
Try this
Anonymous
Abrar
Aahhh..I see
Abrar
He said this?
Anonymous
not working
You dont mean exactly what is not working, is it not giving output?? Because there is no error in code
Anonymous
Hello... I just completed python and I want to learn Django can you please send me some books or videos link for learning Django...
Doragonsureiyā
Hello... I just completed python and I want to learn Django can you please send me some books or videos link for learning Django...
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Thanks :)
Manuel
somebody help please how can I handle this
Manuel
ImportError raised when trying to load 'crispy_forms.templatetags.crispy_forms_field': No module named 'django.utils.lru_cache'
Manuel
I got 3.6.9
saran
Is it compatible or not
saran
Django version?
Manuel
let me check
saran
Plz check crispy form version to.. Check the documentation also whether its compatible or not
Manuel
3.06
Manuel
is the django-version
saran
Crispy form version?? 1.8.1?
Manuel
it's allready working was the django version thanks so much
Romila
Do anyone have sample project of django rest API which can guide me to how to fetch data and the operation
Anonymous
https://www.django-rest-framework.org/
Anonymous
hi everyone i need your help
Anonymous
how can i identify authenticated user is a "custem user" or "admin user"
Anonymous
sry for my bad english
iiiiiiπoW
Hi I have a datefield start_date= models.DateField(help_text=' please use the following format : <em>MM-DD-YYYY </em>') I want to make the field shows the format of date. And user cannot type any other values, only user can select the date.
Henry
Please I am having a little challenge with sign up form I am trying to have country state and city input field and they should depend on each other How can I fix this please???
Aryan
Please I am having a little challenge with sign up form I am trying to have country state and city input field and they should depend on each other How can I fix this please???
Just write that logic in validation mention Def clean() and get the country and city like CT= forms.cleaned_data.get("country”) like this and add the condition and check there. You can also validate phone number according to county .
Adonis
https://blog.adonissimo.com/handling-seo-with-wagtail-cms-ckaljqhr100r0bbs1gq44b4nv handling SEO in a Wagtail CMS (django) site.
.
I've building a registration form. Whenever a user fills the form and hits the submit button I want to redirect him/her to a preview page to see their submissions. How do I make the preview page? I'm having troubles with it.
Anonymous
from django.shortcuts import redirect def <func>(request): ...... return redirect("/")
Anonymous
or something like that ("../")
Anonymous
Hello I am New Here and I have just started learning Django. I just want to know how to add own images on website?
Abrar
Now is working
Jooo , Out of curiosity , what was the error?
Anonymous
Be more specific about what you want
I have seen many tutorials about adding images to a folder named static but i didn't understand much
Muslim
Hello I am New Here and I have just started learning Django. I just want to know how to add own images on website?
Google it, read the docs and don’t waste people’s time, ask question when u have real problem
John
Hi, how to make a table with pagination, sorting and search in all fields?
Sh
Hi I have a datefield start_date= models.DateField(help_text=' please use the following format : <em>MM-DD-YYYY </em>') I want to make the field shows the format of date. And user cannot type any other values, only user can select the date.
def get_form(self, request, obj=None, change=False, **kwargs): form = super(YouModelAdmin, self).get_form(request, obj, **kwargs) form.base_fields['start_date'].widget.attrs['readonly'] = True return form Define this function in modelAdmin. IT should solve it
Муродали
who knows? about POWER BI, and how is it work. need i python, when i using power bi ?
Anonymous
I am trying to add a media folder in settings.py but when I reload the server it says val = getattr(self._wrapped,name) attributeerror: 'settings' object has no attribute 'MEDIA''
Anonymous
Anyone can help
Romila
I am trying to get type of form from value from html which is in same div as all type when I take that the last one type value is coming how do I get when I click on particular form it should give me that form type only
Romila
All forms are in single form tag
Romila
I'm taking it in type field