Pull Data From The Database - Django Databases #3

preview_player
Показать описание
In this video I'll show you how to pull data from the database and output it onto a webpage with Python and Django.

In the last video we created our database class and pushed our migration into the database. We also added some data to the database thru the Django admin area. In this video I'll show you how incredibly easy it is to pull that data back out of the database and output it onto the screen.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Django Database Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
Take $30 off with coupon code: youtube1

Codemycom
Автор

John, you are a godsend. Thank you so much for this series, for someone like me who knows Python but has no experience with databases this is just incredibly helpful. Most tutorials just skim right past the topics you cover here leaving you with the knowledge of “copy this code and paste it into your file.” Thanks again,

-Dylan

SchoonDawg
Автор

Sir, you can't even imagine how much this video helps me . I was just about to give up in django because of these database's stuff .
Thank you so much ....×100 🤗

spiralgaming
Автор

So simple and straight forward. I'm a newbie and 99% of the videos I've gone through confused me a lot. My problem has now been solved ... Lemme also subscribe.

upuzitu
Автор

thank you for making this videos, this has really helped me in creating my final year project

adityajain
Автор

Very concise and valuable, thank you!

PatrickMiles
Автор

Thank you so much! This is so amazing. I was about to give up and switch to a different framework. Will be subbing and following channel!

greetingsgentlemen.
Автор

I need help can we show john data to john only when john signs in and similarly mary data if mary signs so that they wont see other data

GamesandTechs
Автор

Hi How we can add to username filed and what are the steps?

srinivasulug
Автор

Nice explanation .I didn't pass object parameter to html file but I know my mistake now

vardhanshah
Автор

Hello jhon.is there a way to extract from a table to an other on in the same db for example if i want to to move it from table to on other one base on some conditions

mohamedelmabrouki
Автор

I followed the video and used it in my project, but in the end it did not work.. the screen was all blank.. Do you know what could be the problem?

My model:
from django.db import models

class Posicao(models.Model):
nome = models.CharField('Posição', max_length=5)
descricao = models.TextField('Descrição', max_length=1000)
secao = models.ForeignKey(Secao, blank=False, null=False, on_delete=models.CASCADE)
capitulo = models.ForeignKey(Capitulo, blank=False, null=False, on_delete=models.CASCADE)

def __str__(self):
return self.nome


My view:
from django.shortcuts import render
from .models import Posicao

def consultar_123(request):
consultar_abc = Posicao.objects.all()
return render(request, 'consulta_ncm.html', {'all' : consultar_abc})



My urls:
from django.urls import path
from django.views.generic import TemplateView

urlpatterns = [
path('consulta_ncm', TemplateView.as_view(template_name='consulta_ncm.html')),



My html (consulta_ncm.html):
<h1>Hello World</h1>
<p>{{all}}</p>



The outcome:

Hello World

GuilhermeFerreira-xxfg
Автор

Greetings John,

Can you help us with how to use multiple databases and CRUD with 3-4 different databases even cloud PAAS DBs. It would be helpful.

Thanks

divyamshugupta
Автор

50 Likes and no dislike that's awesome

yeeroj
Автор

Hello John, Please how do I add an additional column to an existing database thru models.py? Thank you

stanleyagwu
Автор

Can you make a video for model choice values for a drop down list please

lehstudent
Автор

I want to pull the records of database and store it in an Excel sheet...is this possible sir??

palanikumar
Автор

John, you are a godsend. Thank you so much for this series, for someone like me who knows Python but has no experience with databases this is just incredibly helpful. Most tutorials just skim right past the topics you cover here leaving you with the knowledge of “copy this code and paste it into your file.” Thanks again,

-Dylan

SchoonDawg