#3 Django tutorials | First App in Django - part 1

#3 Django tutorials | First App in Django - part 1

Telusko

5 лет назад

645,983 Просмотров

Check out our courses:

Spring and Microservices Weekend Live Batch : https://bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)

Master Java Spring Development : https://bit.ly/java-spring-cloud

For More Queries WhatsApp or Call on : +919008963671

website : https://courses.telusko.com/

Instagram : https://www.instagram.com/navinreddyofficial/
Linkedin : https://in.linkedin.com/in/navinreddy20
TELUSKO Android App : https://bit.ly/TeluskoApp
Discord : https://discord.gg/D8hWe9BqfF

In this lecture we will learn about:
#1 types of web application
#3 what is inside a django project
#4 how to create a first app in django
#5 what is inside our calc app folder

first App in Django
python manage.py runserver is the command to run the server


#1 we want to build web application
we have two types of web application
1. static web application
2. dynamic web application

Some sites you visit is static web application
e.g visit first time you will get the same page in facebook, twitter, google, etc
which are same for all users

some sites you visit is dynamic web application
e.g my bankaccount detail is different from your bankaccount detail
which are different for all users

for making static web application we use html, css, javascript
Now for making dynamic web application we use Django

Django is a python based web framework

first program:
print hello world using django

Here we are using visual studio for our work

open folder projects thats are created in our 2nd lecture
which are has a separate virtual environment for each project

#2 in this project we have lots of file
inside projects
we have a folder named as telusko
inside telusko there are 3 files
1. manage.py
2.db.sqlite3
3.telusko
inside telusko there are
1. __init__.py
2. settings.py
3. urls.py
4. wsgi.py
5. asgi.py

and one folder __pycache__

-- To do setting open settings.py file
a) we have secret key
b) we have debug (remember before deployment we have to change it to false)
c) we have installed apps
d) we have templates
e) we have databases (by default it is sqlite3)

-- To do urls open urls.py file

#3 we have to create a app
-- to create a app open terminal and type
-- to create calc app
-- to change to our virtual environment
-- to change directory to our project
-- just go on telusko folder and open terminal and type workon test
-- now we are in test
-- just type python manage.py startapp calc
-- now we have a folder named as calc
-- inside this we have differnt file

#5 what is inside our calc app folder
i) in app.py we have
class CalcConfig(AppConfig):
name = 'calc'
-- CalcConfig is a class which is important.

ii) in models.py we have
from django.db import models
-- it is used to hold data

iii) in test.py we have
from django.test import TestCase
-- it is used to test our application

iv) in views.py we have
from django.shortcuts import render
-- it is used to render our html page


Github :- https://github.com/navinreddy20/Python-

Editing Machines & Monitors :
https://amzn.to/2HA6ra8
https://amzn.to/2VMBBPw
https://amzn.to/2RfKWgL
https://amzn.to/2Q665JW
https://amzn.to/2OUP21a.


Subscribe to our other channel:
Navin Reddy : https://www.youtube.com/channel/UCxmkk8bMSOF-UBF43z-pdGQ
Telusko Hindi : https://www.youtube.com/channel/UCitzw4ROeTVGRRLnCPws-cw

Donation & Support:
Indian Payment : https://www.instamojo.com/@NavinReddy/
PayPal Id : navinreddy20
Patreon : navinreddy20

Тэги:

#telusko #navin #reddy #tutorial #java #python #Django #Web #Framework #app #create #download #install #vsc #visual #studio #open #project #files
Ссылки и html тэги не поддерживаются


Комментарии:

@Telusko
@Telusko - 04.07.2020 12:00

One Correction :
Its Visual Studio Code not Visual Studio..

Ответить
@dreamy4174
@dreamy4174 - 10.01.2024 06:45

The workon test command is not working on vs code

Ответить
@quick-take2624
@quick-take2624 - 03.12.2023 04:35

workon test doesnt work

Ответить
@bosnianphantom480
@bosnianphantom480 - 10.11.2023 01:24

Can you use python for developing games, and which languages are used for game development besides C++

Ответить
@tugealdinrahma4126
@tugealdinrahma4126 - 18.09.2023 17:48

❤❤❤❤❤❤❤❤

Ответить
@user-gi7oq7yh5f
@user-gi7oq7yh5f - 11.09.2023 07:39

can we use the Pycharm terminal to access it?

Ответить
@user-ht9eb1vl1t
@user-ht9eb1vl1t - 30.06.2023 09:48

Sir , My test environment gets activated in my command prompt but doesn't get activated in my vs code terminal. I have tried many things but my virtual environment is not getting activated sir. Please give me a solution for this sir.

Ответить
@DileepKumar-qz3ew
@DileepKumar-qz3ew - 17.06.2023 06:18

When i go to my bank server i will see my bank balance not your's bank balance 😂

Ответить
@vasumitapudi5266
@vasumitapudi5266 - 04.06.2023 19:30

workon command is not working

Ответить
@theonlymaster9374
@theonlymaster9374 - 20.05.2023 19:36

you should have mentioned about selecting terminal as cmd by default vs code will open power shell, i tought in my system in vscode i cannot open the test vemv, searched google, asked GPT, no use, finally i observed that you had cmd as your terminal and i tried to see if i can open cmd in vs code boom, there it was and now thet test vemv works, but simply i installed django in my system

Ответить
@khushboodubey2647
@khushboodubey2647 - 23.04.2023 15:37

It did work 🎉 thank you ❤

Ответить
@rajeshadabala691
@rajeshadabala691 - 01.04.2023 19:44

Beginners mistakes:you should select command promt in terminal...not powershell
2)you should select python interpreter in vscode otherwise.....django will not work

Ответить
@kumarisangam9387
@kumarisangam9387 - 21.03.2023 07:57

Waisted 2 days

Ответить
@kumarisangam9387
@kumarisangam9387 - 21.03.2023 07:56

App is not creating i wrote same command but it's not working

Ответить
@niharikapatel5114
@niharikapatel5114 - 13.03.2023 13:04

my workon test is not working sir. do u have any idea sir what is wrong?

Ответить
@rahulwaghela3929
@rahulwaghela3929 - 04.03.2023 16:21

tell me how to find our virtual env name

Ответить
@anything5874
@anything5874 - 20.02.2023 20:20

SIR can u pls tell me what to do if workon command does not work?

Ответить
@gauravlakhina8412
@gauravlakhina8412 - 13.02.2023 18:21

You can easily cut any part in the video or re-create but this is your way of showing that we might get stuck and that is the lovely thing about you, you are not just teaching in flat flow, you are even teaching us about the mistake we can make and think to drop of this plan of learning coding, sometime we get stuck and it feels like leaving until we are full of passion and perseverance. Thank you bro so much!

Ответить
@swayamgupta8708
@swayamgupta8708 - 13.02.2023 15:47

your videos are made in such a way that , at the end we are left with no issues

Ответить
@sushantkshatriya3592
@sushantkshatriya3592 - 28.01.2023 08:00

can you tell me how to add multiple app in django

Ответить
@fakirashahul996
@fakirashahul996 - 27.01.2023 07:40

Thank you sir.The videos and explanations are precise, understandable, easy to follow, precisely paced and implementable.

Ответить
@rajeshpulletikurthi7571
@rajeshpulletikurthi7571 - 23.11.2022 08:02

in Visual Studio Code , "workon test" command is not working. can anyone HELP

Ответить
@universalsoldier5622
@universalsoldier5622 - 16.11.2022 08:51

Pukni saala bakwaas jyada karra time waste video

Ответить
@topzhitz3530
@topzhitz3530 - 14.10.2022 20:15

Is pycharm okey?
Please pin

Ответить
@sncreation7793
@sncreation7793 - 12.10.2022 17:24

I write same code and follow same step
But I have so many error

Ответить
@rutujapatil5568
@rutujapatil5568 - 04.10.2022 08:08

sir 'workon test' this cmd not working in my pc

Ответить
@ameymore7528
@ameymore7528 - 16.08.2022 09:57

While opening the app calc it is giving me error that "Couldn't import Django". Any body please help me 🙏

Ответить
@secularbaazi8595
@secularbaazi8595 - 06.08.2022 10:35

who face problems, use vscode cmd instead of powershell to create calc

Ответить
@junaedahmed8387
@junaedahmed8387 - 22.07.2022 08:20

Hats off to the Johny sins of programming

Ответить
@josephmanifold9211
@josephmanifold9211 - 30.06.2022 07:17

For anyone who had the same issue as me with the workon command not being recognized, it's either because:
- You are on Windows and not in the cmd shell
- You are on another OS
For me, I am on Linux, so I used the command
source test/bin/activate
Make sure you are in the right directory first.
Hope this helps someone!

Ответить
@mcbotface
@mcbotface - 25.06.2022 19:59

That's Visulal studio code !!!

Ответить
@nikhilkp6930
@nikhilkp6930 - 02.05.2022 15:17

Workon test in visual studio did not go to virtual environment

Ответить
@iayushbhartiya
@iayushbhartiya - 28.04.2022 18:27

If anyone face error at time of creating calc app, check whether you are using PowerShell or cmd.

Ответить
@Mukeshkumar-yl1qq
@Mukeshkumar-yl1qq - 08.04.2022 08:20

thank you sir

Ответить
@nkcreations2614
@nkcreations2614 - 19.03.2022 09:08

While im trying to run the surver Its showing cant open file and [errno 2] no such file or directory plz help me sir

Ответить
@lavanya9850
@lavanya9850 - 14.01.2022 13:43

Error : Workon is not recognised as an internal or external command

Ответить
@jobinmj2705
@jobinmj2705 - 28.12.2021 13:38

somebody pls help i get the same error when i write command workon

Ответить
@Worksaftercollege
@Worksaftercollege - 26.12.2021 14:10

Sir i am unable to use workon in VSCode

Ответить
@aluuusch
@aluuusch - 27.10.2021 18:50

Too fast at the section about the virutal environment. There is acutally a bunch of things to do before the terminal in vsc would work as show in the video

Ответить
@code_bit
@code_bit - 25.09.2021 13:53

why do you call us aliens

Ответить
@ajitdesai2999
@ajitdesai2999 - 27.08.2021 11:35

Bhai, U r not using Visual Studio🤦🏻‍♂️🙄 that's Visual Studio Code.
Not even once, u said VSCode.
"VSCODE".
You don't need to explain Community/professional or blah blah for VSCode.!

Ответить
@infan7472
@infan7472 - 29.07.2021 13:11

He didn't mention that it will done with cmd. I using workon command for 2 days in the powershell .now only i know that . he jumped that. pls sir Don't jump between progress.
Thank you.

Ответить
@SamaresMandal
@SamaresMandal - 19.07.2021 09:58

Terminal not opening

Ответить
@aok3941
@aok3941 - 16.07.2021 17:32

sir i am using atom,in atom ide "workon test" doesn't works

Ответить
@satyamgupta5282
@satyamgupta5282 - 17.06.2021 12:56

workon is not recognised as an internal or external command
although I have install workon

Ответить
@krithikr7072
@krithikr7072 - 29.05.2021 18:37

workon cmd is not working what to do???

Ответить