Try DJANGO Tutorial - 17 - Rendering Context in a Template

preview_player
Показать описание
Try DJANGO Tutorial series is here to teach you Django bit by bit.

Рекомендации по теме
Комментарии
Автор

Man you're the best teacher I found for Django. I wish that I saw this channel before purchasing a course from udemy. The other guy literally has crammed the source code and just reads it out. Thanks a lot Man.

nitishgupta
Автор

"It's not a bug, it's a feature " :D
No pun intended. Love your videos, first really comprehensive Django tutorial I found.

НиколайТодоров-ит
Автор

Thank you so much for these videos! I usually don't comment on anything, but your videos deserve more from the Youtube algorithm god, since you explain these concepts in a perfectly succinct manner. It's so easy to follow and implement myself. Well done and keep it up!

kleiben
Автор

my advice to everyone is learn django from codingentrepreneurs but learn 15, 16, 17 tutorials twice from coding enterpreneurs and once from telusko for indepth understanding, dont forget to practice as much as CodingEnterprenuers <3

yusharthsingh
Автор

Excellent explanation! Ten trillion times better than scouring Stack Overflow wastelands.

Circumvenscion
Автор

i was so confused about the context, thanks . subscriber++

sumitrana
Автор

Very very nice videos... love these .. and great job.. no words.. thanks a

VenkataRamaRajuLolabhattu
Автор

Great Job Sir, Appreciate the time and effort you put into these.

nareshsekar
Автор

great job. you are really good teacher!

innowellinfo
Автор

Thank you very much, though I did not use the exact way you mentioned, I got where my code was wrong. Gracias.

harisundar
Автор

this is technological democracy at its best

MasalaMagic
Автор

Hi dear thank you for your tutorials..
If i have a pages app.. and another app(products)
And i have in products.view a suggestion view which has context and template with no urls..
Can i use include this view in any of my pages.templates with its own context ???

faresgeek-dz
Автор

Quick question: how is the dictionary assigned to the context populated? you hard-coded it here with an example, but where does the data come from?

mihaelacostea
Автор

what happens if you have lots of different things on one page (say on there you have 3 different sections, header, footer, sidebar, etc etc), does that mean you end up with a very large view to handle it all? Is there a way to split views into smaller parts of the whole?

dpapa
Автор

Do you have to restart the server every time you change the values in the context? Because for me, the template reads it the 1st time but if I change it, save and refresh, it does not read it anymore

anuragC
Автор

Do you need to have an about.html to follow this tutorial?

derekkroeker
Автор

Thanks for your excellent video. I have this small program
def frequencies(request):
listafrequencias ={
"lista" :[]
}

f0 = 440
for i in range(0, 10):
lista[i] = f0 * 2**(i/12)
return render(request, 'showfrequencies.html', listafrequencias);
and django produces this error: NameError: name 'lista' is not defined. Can you help to find this error, please? Thanks.

douglaslopez
Автор

I have a problem! I have done every single step until this one when he creates custom/ tags in templates and I simply cannot load {{ }} tags.. they do not show!!! I use PyCharm community version. I was following another tutorial from an amateur for (I use Django 3.1) python 3.6.5 ..sooo... PLEASE HELP!

lafamilliaHP
Автор

Anyone have any good resouces for how to do this in class based views?

fowad
Автор

I have a question for you, i'm trying to list out the data for product_name. Well having a form attached making a post too order_amount. I'm going for a spreadsheet looking view as the template. If i could blend a listview with a formview would be perfect, any suggestions or help is much appreciated. Thank you for taking the time to read this, as well as making some really great videos, been following you since my Django journey started.
models.py
class Product(models.Model):
product_name =
par_amount = models.IntegerField()

def __str__(self):
return self.product_name


class Order(models.Model):
product_name = models.ForeignKey('Product', on_delete=models.CASCADE)
order_amount = models.IntegerField()


forms.py
class OrderForm(ModelForm):
class Meta:
model = Order
fields = ['product_name',
'order_amount',
]
views.py
class ProductList(ListView):
model = Product
template_name = 'items/product_list.html'


class OrderFormView(FormView):
form_class = OrderForm
template_name = 'items/order_form.html'
success_url = '/thanks/'

def from_valid(self, form):
return super().form_valid(form)

class ThanksPage(TemplateView):
template_name = "items/thanks.html"

oliverspizza