Himanshu
Where I can learn django from initial
Prefer documentation. The deeper you read and implement, the better you are. Django document also mention the ways to optimise ORM queries, which most the videos don't explain.
Sandeep
Guys can any one tell how can I store list of data in settings.py from frontend?
Timur
help me please. When starting a project, this error NoReverseMatch at /cart/add/1/ 'cart' is not a registered namespace views: def product_detail(request, id, slug): product = get_object_or_404(Product, id=id, slug=slug, available=True) cart_product_form = CartAddProductForm() return render(request, 'web/tovar.html', {'product': product, 'cart_product_form': cart_product_form}) url: path('', views.cart_detail, name='cart_detail'), path('add/<int:product_id>/', views.cart_add, name='cart_add'), path('remove/<int:product_id>/', views.cart_remove, name='cart_remove'), template: <div class="{{ product.group }}"> <img src="{{ product.img.url }}" alt=""> <h3>{{ product.name }}</h3> <p>Цена:{{ product.price }}</p> <h3>{{ product.description }}</h3> </div> <p class="price">{{ product.price }}</p> <form action="{% url 'cart_add' product.id %}" method="post"> {{ cart_product_form }} {% csrf_token %} <input type="submit" value="Add to cart"> </form>
Anonymous
Declare app_name in urls
Sandeep
Declare app_name in urls.py
Any example u can share ?
Anonymous
Yeah, i can share a video
Anonymous
I have recently created it
Sandeep
Ok pls share
Anonymous
I have messaged you as i can't send video links here
Anonymous
You can even visit my channel, "The Coding Humans" and see it.
Sandeep
Thanks I'll check this.. Thanks for help
Timur
And then use app_nane:url_name
I don’t quite understand something, I'm just new to django
Timur
sry((
Anonymous
Umm, okay
Anonymous
When working with URLs, Django gives you ability to namespace everything, this allows you to use same name without collision
Anonymous
I don’t quite understand something, I'm just new to django
In each URLs, you can declare app_name variable and later use it.
Anonymous
Message me, ill send you a link to a video to understand it in a lot more detail.
Anonymous
This is giving me an error
Anonymous
'NoneType' object has no attribute 'instance
Anonymous
I want to save in Profile model the instance user
snc
def str_(self) :
Anonymous
yes it is def str(self)
Anonymous
still getting that error
Anonymous
str
Anonymous
It is def str(self)
Anonymous
the underscore is not visible in telegram
Anonymous
but i have written in my coed though
Anonymous
code*
Anonymous
Oh
Anonymous
I know that
Anonymous
I would have show what exactly the error is by a img
Anonymous
can you dm
Murad
hello all. Guys, help who knows how to decode this in utf8 — "%25d0%25a2%25d0%25b5%25d1%2581%25d1%2582"
venkatesh
Gender choice filed define default value like none or M like choice value
Anonymous
please helpme🙏. i'm not getting keys and values in html page.. https://pastebin.com/WLVJpAxq
D
hello all. Guys, help who knows how to decode this in utf8 — "%25d0%25a2%25d0%25b5%25d1%2581%25d1%2582"
It is a word "Тест" Which is "Test" in Russian %25 == % https://www.utf8-chartable.de/unicode-utf8-table.pl
D
anybody may help me with this?
Do you get something on print(row, type(row))? Could you add it you code sample?
D
I've never done direct calls to DB, and not sure — do you get list of dicts? Can you do: {% for ro in row %} {{ ro }} {% endfor %} Will it print dicts? Do these dicts have items key?
Anonymous
Yes, it gives dictionary list in html page but how can i get each key, values..
D
I've never done direct calls to DB, and not sure — do you get list of dicts? Can you do: {% for ro in row %} {{ ro }} {% endfor %} Will it print dicts? Do these dicts have items key?
Oh snap, I'm dumb. .items is dict's method. OK. So ro should be a dict and all should work. You either are getting serialised dict from DB and need to deserialise it, or I don't know then
Anonymous
Hello everyone, I'm new, I'm welcome to you?
Anonymous
Sure
Yes really!
Anonymous
Did anyone has any series of djnago learning or class of online learning
I have taken an initiative to help everyone master Django 3 for free. Just search for "The Coding Humans" on YouTube and follow along with it by subscribing.
ecDesign
Anyways, is anyone working on some cool project?
QRico.eu maybe, I made it in my free time the last two weeks
S_8634
Haii guys...I am doing an e-commerce project for my college final year project...can anyone give instructions to how to add products to the cart..
ecDesign
Sh
Create Cart table
Sh
link it with products
S_8634
When I click on add to Cart the item should appear in the cart...
S_8634
there are vidoes on youtube that can guide you
I have checked but...not well..
Mirco
When I click on add to Cart the item should appear in the cart...
there are loooots of examples, books and tutorials about e-commerce, just spent time on searching and studying
Mirco
if u wanna build a good product
Mirco
Thank u..
for example Professional Django 2 book explains from the beginning how to build a simple e-commerce with all basic funcionalities
S_8634
Cyrus
Hey any good django rest project github repository from which I can learn?
Bjorn
Well then pay the price. Don't ask for pirated content here. Read the rules.