Тёмный

Django Models.py - Django Databases #2 

Codemy.com
Подписаться 229 тыс.
Просмотров 49 тыс.
50% 1

To create a database table in Django, all we have to do is write a little python code in our models.py file to define a Class and then designate the fields we want to add to the database.
In this video I'll show you how to create a Member table that records first name, last name, email address, password, and user age. We'll also register our model so that we can access it from the Django Admin area.

Опубликовано:

 

28 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 73   
@Codemycom
@Codemycom 4 года назад
▶️ Watch Entire Django Database Playlist ✅ Subscribe To My RU-vid Channel: bit.ly/2uiNq86 bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com Take $30 off with coupon code: youtube1
@yeerojcodes3020
@yeerojcodes3020 4 года назад
i like the way u start these awesome videos ...so much full of energy
@Codemycom
@Codemycom 4 года назад
Thank you so much 😀
@anselsolomon6270
@anselsolomon6270 4 года назад
I like this, u kept it very clear and simple..Thanks
@Codemycom
@Codemycom 4 года назад
Glad you enjoyed it!
@thomaspaine6082
@thomaspaine6082 3 года назад
You are the smartest Django teacher , thank you very much! Edit: i am learning a lot i am very grateful :)
@Codemycom
@Codemycom 3 года назад
Thank you! 😃
@thomaspaine6082
@thomaspaine6082 3 года назад
@@Codemycom i am learning a lot! Thank you i love your teaching style
@Codemycom
@Codemycom 3 года назад
@@thomaspaine6082 Glad to hear it!
@juanmitilo2668
@juanmitilo2668 2 года назад
Excellent video my friend. Thank you so much. Very helpful.
@Codemycom
@Codemycom 2 года назад
You're welcome!
@spiralgaming8940
@spiralgaming8940 3 года назад
Thank you sir for such a exciting and informative content
@Codemycom
@Codemycom 3 года назад
My pleasure
@ruhiziki6361
@ruhiziki6361 3 года назад
Thanks sir for the awesome videos!
@Codemycom
@Codemycom 3 года назад
Very welcome!
@brucebarrett1273
@brucebarrett1273 3 года назад
To avoid the "Sublime" problem of italic, lower-case el looking upper-case change the font in preferences. For example "Letter Gothic Std" works nicely.
@annisfun1993
@annisfun1993 2 года назад
that was great pls keep the good tutorials
@Codemycom
@Codemycom 2 года назад
Thanks!
@franciscoayracaceres7163
@franciscoayracaceres7163 4 месяца назад
amazing, just super good tutorial
@Codemycom
@Codemycom 4 месяца назад
Thanks!
@sidaliaityahiatene3988
@sidaliaityahiatene3988 2 года назад
Thank you man, you are amazing
@Codemycom
@Codemycom 2 года назад
Thanks!
@rangabharath4253
@rangabharath4253 4 года назад
Thank you so much 😁👍
@Codemycom
@Codemycom 4 года назад
Thanks for watching!
@vinu1497
@vinu1497 Год назад
Sir you are Incredible..!!! U made it look like It was like teaching a person to eat ice cream...!!! hahaha what an awesome trainer fantastic 🙂
@Codemycom
@Codemycom Год назад
Thank you so much 😀
@mdbarin2014
@mdbarin2014 Год назад
great thanks a lot 🙏🙏🙏
@Codemycom
@Codemycom Год назад
Welcome!
@samuvijayakumar6991
@samuvijayakumar6991 21 день назад
👌
@TechWithSabri
@TechWithSabri 4 года назад
i think this is what we are talking about it sir yes? witch admin can add some staffs in his website and user can like or do staffs also i think this is the main of this tutorial ? this what we need any wway thnx so much for your time
@Codemycom
@Codemycom 4 года назад
Adding things to the admin area is one thing...having those changes reflect onto the website is a whole other complicated thing...
@TechWithSabri
@TechWithSabri 4 года назад
@@Codemycom look sir i will give you an example a client he is a bodybuilding want to create his own website.(videos website) after you create the website and you add the videos he gave it to you, he want also after weeks to add some videos or pictures without contacting you . . . . whats the steps in this case if you can make some videos about this prblm i will be very happy and appreciate that. thnks a lot for your time.
@davecox3013
@davecox3013 4 года назад
I notice at 18:40 you hit save in the script and reload on the website, the change is immediate. Did you migrate again to do this because I've saved my work but still have members object there. Cheers mate!
@Codemycom
@Codemycom 4 года назад
No, I didn't migrate.
@davecox3013
@davecox3013 4 года назад
Ok sorry
@Codemycom
@Codemycom 4 года назад
@@davecox3013 nothing to be sorry about
@ideal7761
@ideal7761 3 года назад
@@Codemycom Thanks for the great tutorials; how do I go past what @Dav Cox has mentioned here? I have hit the same snag, added: def __str__(self): return self.fname + ' ' + self.lname to models.py, saved but Members object (n) still appears instead of member names.
@ideal7761
@ideal7761 3 года назад
Got it. Indentation was not right; it should be aligned this way: class Members(models.Model): fname = models.CharField(max_length=50) lname = models.CharField(max_length=100) email = models.EmailField(max_length=200) passwd = models.CharField(max_length=50) age = models.IntegerField() def __str__(self): return self.fname + ' ' + self.lname
@JJ-ot3ps
@JJ-ot3ps 2 года назад
hi there, what is models.Model? I guess the first models is from django class, and what is the second Model mean?
@Codemycom
@Codemycom 2 года назад
it's just how django does it
@udhayhakarthik6792
@udhayhakarthik6792 2 года назад
Where does this database reside? Was it SQL or something else?
@Codemycom
@Codemycom 2 года назад
it's the default database that comes with django
@bhushanwagh7192
@bhushanwagh7192 4 года назад
Can you make a video... How to integrate machine learning with tkinter Or have a any idea about this please let me know.. Please
@Codemycom
@Codemycom 4 года назад
Maybe...but if you know machine learning...and you know tkinter...there's not much else to learn ;-) I have a matplotlib tikinter video in the playlist I think...
@bhushanwagh7192
@bhushanwagh7192 4 года назад
@@Codemycom thank you so much... 👍😊
@Codemycom
@Codemycom 4 года назад
@@bhushanwagh7192 Sure thing!
@tripathi5174
@tripathi5174 4 года назад
Sir what if we have a admin and I want to delete that admin and create a new superuser, will all the data of my project or website will be lost or the actions performed by the previous admin will be lost? or there will be no change at all if i create a new super user with different name and password please help i am not able to access my previous admin and i am getting an error called as User.profile.RelatedObjectDoesNotExist: User has no profile. Please help
@Codemycom
@Codemycom 4 года назад
Good question. Your data won't be lost. The data is in the database, it's not tied to the superuser. Just create a new superuser and you'll be fine.
@tripathi5174
@tripathi5174 4 года назад
@@Codemycom thankyou so much sir
@Codemycom
@Codemycom 4 года назад
@@tripathi5174 Sure thing!
@shoxruxsunnatov
@shoxruxsunnatov 3 года назад
Hi, how many years of experience do you have?
@Codemycom
@Codemycom 3 года назад
I've been coding for 35 years
@yaboobayyaboobay8191
@yaboobayyaboobay8191 26 дней назад
The model is not showing in the admin page for me
@Codemycom
@Codemycom 25 дней назад
what did you do differently from the video?
@SA-es5gs
@SA-es5gs 3 года назад
does Django is secure?
@Codemycom
@Codemycom 3 года назад
Yes
@Kevin-hl8iw
@Kevin-hl8iw Год назад
Thank you Walter White
@Codemycom
@Codemycom Год назад
lol
@toshiharu7630
@toshiharu7630 8 месяцев назад
walter white in the world of programming xd
@Codemycom
@Codemycom 8 месяцев назад
lol
@ecodersofficial
@ecodersofficial 2 года назад
You're in the 3rd generation of sublime text. Upgrade to its 4th generation!
@ajaydubey304
@ajaydubey304 2 года назад
if you stuck with table error like i did use this command in new django update python manage.py migrate --run-syncdb
@ahmetburakkarhan130
@ahmetburakkarhan130 3 года назад
you look like walter white
@Codemycom
@Codemycom 3 года назад
ha
@justgames123
@justgames123 4 года назад
Glad to see you have moved on from selling meth Walter White
@Codemycom
@Codemycom 4 года назад
lol
@justgames123
@justgames123 4 года назад
@@Codemycom informative video, thanks
@finitoSA
@finitoSA 9 месяцев назад
Please, don't concatenate! I'm scared... It's easier and prettier to use fstrings - like this: variable = 'fcking' return f'This is {variable} awesome'
@ecodersofficial
@ecodersofficial 2 года назад
You're in the 3rd generation of sublime text. Upgrade to its 4th generation!
@Codemycom
@Codemycom 2 года назад
Why? There's no reason to.
Далее
Pull Data From The Database - Django Databases #3
12:26
Using Databases With Django - Django Databases #1
11:48
🎤Пою РЕТРО Песни ✧˖°
3:04:48
Просмотров 1,7 млн
С Анджилишей на тусе💃
00:15
Просмотров 139 тыс.
Самоприкорм с сестрой 😂
00:19
Просмотров 281 тыс.
Understanding Django Model Relationships
25:56
Просмотров 94 тыс.
Django Tutorial - SQLite3 DataBase Tutorial
22:49
Просмотров 174 тыс.
Django Rest Framework for Beginners - Simple CRUD API
14:22
Python FAST API Tutorial
58:20
Просмотров 319 тыс.