Start a Django project and file structure
Summary
TLDRThe video script is a tutorial focused on welcoming viewers to a coding session with tea, highlighting the launch of an official playlist. The target is set at 600 comments to encourage viewer interaction. The host discusses exploring and being ahead of many, targeting the video for those familiar with JavaScript frameworks like NestJS or Express. The tutorial covers setting up the environment for a Django project using a framework known for rapid development, emphasizing its scalability and efficiency. It touches on creating a virtual environment, installing packages like 'uvicorn', and setting up a Django project, including activating the virtual environment and managing dependencies.
Takeaways
- 😀 The video is a welcome address to the audience, inviting them to a coding session focused on 'Chay and Jango'.
- 📝 The presenter sets a target of 600 comments for the video and encourages viewers to support by commenting.
- 💻 The video aims to demonstrate rapid development using Jango, a framework that is easy and fast to work with, especially for those with a JavaScript background.
- 🔧 The setup process involves creating a folder, setting up the environment, and sharing the screen for a more interactive session.
- 🛠️ Jango is described as a framework that requires minimal setup and is known for its speed, scalability, and security features.
- 🌐 The video mentions that Jango is well-suited for minimal systems and can handle a significant number of users even on a $10 machine, making it appealing for corporate use.
- 🔄 The presenter discusses the process of creating a virtual environment using 'uv' (a package manager) and activating it, which is crucial for managing dependencies.
- 📝 The video script includes a detailed guide on installing Jango, including commands for different operating systems and the use of 'pip' for package installation.
- 🚀 The presenter emphasizes the speed of Jango, stating that it's so fast that slowing down the demonstration is challenging.
- 🔧 The video concludes with a brief exploration of the Jango project structure, highlighting files like 'manage.py' and the importance of the 'settings.py' file for configuration.
Q & A
What is the target for the number of comments in the video?
-The target set for the number of comments in the video is 600.
What does the speaker suggest doing before starting to code?
-The speaker suggests taking a moment to relax with a cup of tea to set a comfortable environment for coding.
What is the speaker's preference for writing code?
-The speaker prefers writing code directly in a code editor.
What is the framework that the speaker is discussing in the video?
-The speaker is discussing the Django framework, emphasizing its rapid development capabilities.
What does the speaker mean by 'Rapid Development' in the context of Django?
-By 'Rapid Development,' the speaker refers to Django's ability to quickly develop applications with minimal effort due to its 'batteries-included' philosophy.
What is the significance of the word 'Ridiculously' in the context of Django's speed?
-The word 'Ridiculously' is used to emphasize the exceptionally fast development speed that Django offers, setting it apart from other frameworks.
What is the recommended approach for setting up the development environment for Django?
-The recommended approach is to use a virtual environment, which isolates the project's dependencies from the system's Python installation.
What is the command to create a virtual environment using Python's venv module?
-The command to create a virtual environment is `python -m venv .venv`, where `.venv` is the name of the virtual environment directory.
What is the purpose of the 'activate' script in a virtual environment?
-The 'activate' script is used to activate the virtual environment, which applies the environment's settings to the current shell session.
How does the speaker describe the process of installing Django within the virtual environment?
-The speaker describes installing Django using the command `pip install django` after activating the virtual environment.
What is the initial command to start a new Django project according to the video?
-The initial command to start a new Django project is `django-admin startproject`, which creates a new Django project directory.
Outlines
😀 Introduction to Tea and Code
The speaker warmly welcomes the audience to the Tea and Code session, expressing excitement for the official launch of their playlist. They set a target of 600 comments for the video and encourage viewers to support by commenting. The speaker emphasizes their preference for writing code directly and plans to explain things in detail, aiming to make the process as easy to understand as possible. They introduce the topic of rapid development using a framework that is highly scalable and efficient, especially for those with a JavaScript background. The speaker assures that even complex tasks will be explained in a way that they might not need to slow down the pace due to the simplicity and speed of the framework.
🛠️ Setting Up the Development Environment
The speaker guides the audience through setting up the development environment, starting with sharing their screen and showing the 'Tea Jango' folder, which is part of the MT folder. They mention having a terminal open to execute commands and briefly discuss the theme they use. The focus then shifts to creating a virtual environment using 'python-tk' and 'code', emphasizing the importance of a clean and organized setup. The speaker discusses the benefits of using 'jango' over other frameworks, especially for those with a JavaScript background, and touches upon the scalability of applications built with jango. They also mention the ease of deployment and how it is favored by corporations due to its efficiency and cost-effectiveness.
💻 Deep Dive into Jango and Project Setup
The speaker provides a detailed walkthrough of installing jango and setting up a project. They discuss the importance of using 'uv' to create a virtual environment and the various ways to install 'uv', including using pip. The speaker then demonstrates how to install jango within the virtual environment and how to start a new project using 'jango-admin'. They explain the structure of a jango project, including the 'manage.py' file and the project folder. The speaker also touches upon the concept of apps within jango and the importance of the 'settings.py' file for configuration.
🌐 Exploring Jango's File Structure and Default Settings
The speaker delves into the file structure of a jango project, highlighting the importance of the 'manage.py' file as the starting point and its role in setting up various environment variables. They discuss the significance of the project folder and the standard practice of organizing files and folders within it. The speaker also explains the role of 'settings.py' in configuring the entire jango application, including database settings, and the use of SQLite as the default database. They mention the ability to switch between different databases with minimal code changes and the flexibility jango offers in terms of database interaction.
📝 Understanding Jango's Routing and Views
The speaker explains the concept of routing in jango, focusing on the 'urls.py' file that handles URL patterns and directs them to the appropriate views. They discuss the role of 'views.py' in defining business logic and how it interacts with the database through the 'models.py' file. The speaker also touches upon the importance of the 'settings.py' file for project-level settings and the structure of jango applications. They provide a brief overview of the default admin dashboard and the authentication system provided by jango. The speaker concludes by encouraging the audience to explore the application further and to stay tuned for the next video, where they will delve deeper into customizing templates and working with static files.
Mindmap
Keywords
💡Jango
💡Virtual Environment
💡Dependencies
💡Rapid Development
💡Python-Tk
💡Activate Script
💡Database
💡Settings.py
💡URLs.py
💡Templates
💡Static Files
Highlights
Welcome to the official launch of the 'Chai and Code' playlist series.
The target for this video is to reach 600 comments quickly.
The presenter enjoys writing code directly and will demonstrate coding in the editor.
A brief introduction to the 'slow down' button, which won't be needed as the development speed is very fast.
Introduction to the 'Jango' framework, known for rapid development.
Jango is highly scalable and works well even on minimal systems.
Jango is popular among corporations due to its ability to handle many users on low-cost machines.
The presenter will guide through setting up the environment for Jango.
Explanation of creating a virtual environment using 'uv' or 'virtualenv'.
Instructions for installing Jango using 'pip' and activating the virtual environment.
The importance of using 'uv' before 'pip' when working within a virtual environment.
How to start a new Jango project using the 'jango-admin' command.
An overview of the project structure created by Jango, including the 'manage.py' file.
Running the development server with 'python manage.py runserver'.
Exploration of the default admin interface provided by Jango out of the box.
Discussion on the use of SQLite as the default database and the option to switch to PostgreSQL.
Introduction to the 'settings.py' file, which contains all the configuration for the Jango project.
Explanation of the 'urls.py' file, which handles routing in the application.
Overview of the 'views.py' and 'models.py' files, which handle business logic and database models respectively.
Transcripts
हां जी कैसे हैं आप सभी स्वागत है आप सभी
का चाय और कोड में और स्वागत है आप सभी का
हमारी ऑफिशियल लच हो गया है हमारी
प्लेलिस्ट का चाय और जंगो हां जी काफी
अच्छा सपोर्ट दिखाया आपने
आते हैं पर कोई बात नहीं अगर आप एक्सप्लोर
भी करने आए तब भी आप काफी लोगों से आगे
हैं तो इस वीडियो का हम टारगेट रखते हैं
ज्यादा नहीं 600 कमेंट्स का टारगेट रखते
हैं फटाफट से एक कमेंट करके जाइएगा मुझे
बड़ा अच्छा लगेगा आप सपोर्ट दिखाएंगे तो
तो चलिए जी शुरू करते हैं हमारी जंगो की
सीरीज और जैसा कि आपको पता है अ
डायरेक्टली मैं कोड लिखना ही पसंद करता
हूं तो हम सबसे पहले कोड एडिटर में ही
चलेंगे लेकिन उससे पहले एक छोटी सी बात
बता दूं कि आराम से चाय लेके बैठिए मैं
कोशिश करूंगा चीजों को ज्यादा से ज्यादा
समझाने की और स्लो डाउन करने की अ बट
एक्चुअली मैं ना
में आप देखोगे कि चीजें इतनी आसान और इतनी
फास्ट डेवलप होती है कि मैं चाह के भी
उनको स्लो नहीं कर पाऊंगा कुछ जगह ऐसा
नहीं है कि आपको समझ नहीं आएगा समझ में भी
आएगा आप कर भी पाओगे अपने सिस्टम पे बट वो
है ही इतनी फास्ट और हो ही इतनी आसानी से
जाती है कि मेरा उसमें कुछ ज्यादा योगदान
होगा नहीं वो स्पीड में ही चलेगी इसीलिए
जंगो को कहा जाता है रैपिड डेवलपमेंट का
एक एक्सपर्ट अ फ्रेमवर्क और बहुत ही
मैच्योर फ्रेमवर्क है इस फ्रेमवर्क की
अप्रोच या तुलना आप किसी भी और फ्रेमवर्क
से मत करिएगा स्पेशली अगर जावास्क्रिप्ट
बैकग्राउंड से आ रहे हैं जावास्क्रिप्ट
में जो आपने देखे होंगे ने या फिर नेस्ट
जेएस या फिर गेटस बी या इस तरह के जो भी
आपने देखे हैं व कंपैरिजन यहां पे मत
लाएगा यह कंप्लीट डिफरेंट फ्रेमवर्क है
हां अगर आप कभी लरावेल बैकग्राउंड से आते
हैं या रूबी ऑन रेल से आते हैं तो थोड़ा
कंपैरिजन कर सकते हैं बट ज्यादा नहीं ठीक
है तो चलिए जी स्टार्ट करते हैं सबसे पहले
हम थोड़ा सा सेटअप करते हैं एनवायरमेंट और
उसके बाद आपको बताते हैं किस तरह से
करेंगे कमेंट टारगेट मत भूलिए है कि नहीं
चलिए हम आते हैं अपनी स्क्रीन शेयरिंग पे
जंगो पे थोड़ा सा बाद में पहले आते हैं
हमारे वीएस कोड पे वीएस कोड में ज्यादा
कुछ है नहीं थीम हमने चाई थीम ही रखते हैं
हम उसी थीम के साथ ही चलते हैं हम हमेशा
और इसके अंदर मैं एकय फोल्डर ड्रैग एंड
ड्रॉप कर देता हूं जिसका नाम है चाय जंगो
सिर्फ एमटी फोल्डर है इसी के साथ मैं आपको
पूरा एनवायरमेंट सेटअप सब कुछ करना भी
दिखाऊंगा हम यहां पर एक छोटा सा टर्मिनल
भी ओपन कर लेते हैं आज मेरा कीबोर्ड थोड़ा
सा परेशान कर रहा है पता नहीं क्यों मुझे
सुबह सेही कर रहा है ओके तो हमें टर्मिनल
चाहिए एक फोल्डर चाहिए बस दैट सेट अब क्या
करना है कि जब भी आप
python-tk एंड लेस कोड यह बात एकदम सही है
कि कोड आपके पास कंपैरेटिव बहुत कम
क्वांटिटी के अंदर होता है इजी भी होता है
जंगो के बारे में अक्सर जो आपको लोग बात
करते नजर आएंगे वह कुछ इस तरह से होगी कि
रिडिक असली फास्ट हां इस वर्ड के अलावा
कोई वर्ड जमता ही नहीं है यह रिडिक असली
फास्ट ही है उसके अलावा
रिअसेंबल्ड यहां पे होती है आपको उन
प्रोटेक्शन के हिसाब से कोड लिखना होता है
जंगो तो बाय डिफॉल्ट उसको प्रोटेक्ट कर ही
देता है जो कि अच्छी चीज है इसके अलावा
एक्सीडिंग स्केलेबल अच्छा बाय द वे जंगो
की एक छोटी सी कहानी भी बताता हूं आपको
जंगो के अंदर ना स्केल बहुत ही अच्छा
मिलता है मिनिमम सिस्टम्स के ऊपर
जावास्क्रिप्ट के जो सिस्टम्स होते हैं या
जो एप्लीकेशंस होती है उसमें कंपैरेटिव
थोड़ी सी ज्यादा रैम या अच्छा सिस्टम आपको
लगता ही है लेकिन यह जो एप्लीकेशंस है ना
जो जंगो और इस तरह की फ्रेमवर्क्स पुराने
फ्रेमवर्क्स पे बनी होती है ये काफी अच्छा
स्केल करती है बेयर मिनिमम पे तो अगर आपके
पास मान लीजिए आपने डिप्लॉयड की मशीन पे
$10 की मशीन पे तो भी काफी यूजर्स को एक
ही साथ में हैंडल करने कीय पावर रखती है अ
तो हां बिल कमाता है इसलिए कॉरपोरेट्स को
बहुत पसंद होता है जंगो इनफैक्ट आपको पता
भी नहीं होगा ऐसी-ऐसी जगह जंगो यूज़ होता
है
paytm-in x पे ठीक है
python-pip इंस्टॉल जंगो ये वर्जन दे देते
हैं तो भी ठीक है नहीं देते तो भी ठीक ही
है विज पे जाऊं और इस तरह से कर दूं लेकिन
लपमेंट है वो इस तरह से कम ही किया जाता
है प्रोफेशनली स्पेशली क्योंकि कोई भी
एक्सपेक्ट नहीं करता है कि आप
python2 या अलग से एक बॉक्स के अंदर पूरा
डेवलपमेंट करें उसके लिए
python2 का यूज होता है जहां पे एक सेपरेट
अ समझ लीजिए एक इंस्टेंस आ गया सेपरेट एक
सेंड बॉक्स ही आ गया जहां हमारा सारा कोड
जाएगा हमारी मेन सिस्टम पे क्या इंस्टॉल्ड
है उससे उसको खास फर्क नहीं पड़ता है
वर्चुअल एनवायरमेंट को तो इसीलिए आपको हर
कोई
अंदर वर्चुअल एनवायरमेंट बनाता हुआ नजर
आएगा अब वर्चुअल एनवायरमेंट की मैं
कमांड्स आपको बता देता हूं और हम किस तरह
से करेंगे वह भी बता दूंगा अभी मत चलाइए
क्योंकि पहले सुन लीजिएगा पूरी बात ठीक है
चलिए तो अगर आप विंडोज पे हैं तो आप सीधे
ही यहां पे अ पाई से स्टार्ट कर सकते हैं
कि पाई कमांड मैं मैक पे हूं या आप
कि वर्चुअल एनवायरमेंट बनाने के लिए क्या
करते हैं ड m आज तो कीबोर्ड कुछ ज्यादा ही
परेशान कर रहा है ओके तो हम यहां पर लगाते
हैं ड m और उसके बाद आप लिखते हो कि मुझे
चाहिए एक वर्चुअल एनवायरमेंट तो v नवी यह
हमारे
पास v एवी तो यह हमारे पास में बेसिकली
कमांड है जो वर्चुअल एनवायरमेंट देती है
और जो वर्चुअल एनवायरमेंट है वो इंस्टॉल
किस फोल्डर में होगा तो अक्सर लोग डॉट
वनवी नाम के फोल्डर में करते हैं यह डॉट
इसलिए कि जिस तरह से गिट हमारा डॉट फोल्डर
होता है है उसी तरह से वर्चुअल एनवायरमेंट
की भी सारी सेटिंग्स फाइल्स को एक डॉट या
हिडन फोल्डर में रखना लोग अक्सर पसंद करते
हैं यही काम करना है बस इतना सा काम है और
कुछ भी नहीं है एक्टिवेट कैसे करते हैं व
भी दोनों का सेम ही है तो व मैं बता दूंगा
लेकिन मैं जो यूज़ करूंगा यहां पे वह
थोड़ा सा अलग है हमारे पास में कि किस तरह
से मैं जो यूज़ करने वाला हूं उसका नाम है
यूवी यूवी को इंस्टॉल करने के कई तरीके
हैं आप पिप इंस्टॉल यूवी भी कर सकते हैं
या फिर अगर आप और किसी सिस्टम पे है तो आप
पिप से इंस्टॉल कर सकते हैं पिप x से भी
कर सकते हैं ब्रू से भी भी कर सकते हैं और
भी बहुत सारे
mac's एनवायरमेंट से कंपेयर करेंगे तो
जैसे एनपीएम है सारा काम उससे भी हो जाता
है वैसे पिप से भी हो जाता है लेकिन वहां
पे हमारे पास बन है जो कि बहुत फास्ट है
इसी तरह से यवी मेरा नया फेवरेट है
क्योंकि यह एक्सट्रीमली फास्ट पैकेज
मैनेजर है रिटन इन रस्ट तो सिर्फ रस्ट में
होने की वजह से नहीं यह एक्चुअली में इसके
अंदर बहुत सारे पार्सल्स पे काम किया गया
है और यह बहुत बत ही ज्यादा स्पीड है आप
देख सकते हैं स्पीड आपके पास क्या डिफरेंस
आता है 06 वर्सेस खैर ऐसे ग्राफ तो काफी
होते हैं बट आपको सही मायने में एक्चुअली
में देखने को मिलेगा कि हां जी काफी
ज्यादा स्पीड डिफरेंस है तो जैसे आपने
पाइथन इंस्टॉल किया इनमें से कोई सी भी
कमांड चला लीजिएगा पिप चला लीजिएगा या फिर
अगर आप मैक पे है तो पिप 3 चला लीजिएगा या
फिर ब्रू से इंस्टॉल कर लीजिएगा इनमें से
एक ना एक कमांड आपके पास हो जाएगी सर्च
करेंगे जस्ट पिप आपको मिल जाएगा अब उसके
बाद आपको कभी भी अगर वर्चुअल एनवायरमेंट
बनाना है तो पिप अ v एनवी लिखना है बस
इतना सा काम हमें करना है और कुछ भी नहीं
करना है आपको डॉट v एनवी वो कुछ नहीं देना
होता यह ऑटोमेटिक उसका सारा काम कर लेता
है तो अब मैं क्या करूंगा मेरे पास
क्योंकि यूवी ऑलरेडी इंस्टॉल्ड है तो मैं
उस यूवी को ही यूज कर लेता हूं कि प्लीज
यूवी और उसके बाद मैं यहां पे सीधा लिख
दूंगा कि मुझे एक वर्चुअल एनवायरमेंट
चाहिए तो सेम v इ एनवी हम लिख देंगे तो ये
वर्चुअल एनवायरमेंट हमें दे देगा v ई एनवी
ई एनवी तो जैसे ही आपने लिखा तो आपका
वर्चुअल एनवायरमेंट क्रिएट हो गया अब हमें
जो यहां पे फाइल मिली है इसके अंदर वही
एग्जैक्ट सेम चीजें हैं जो आपको नॉर्मली
जो पहले कमांड दिखाई थी उससे आपको मिलती
है तो हमारे पास बिन है बिन के अंदर
python3.7 इंस्टॉल्ड है बिन भी है आपकी
जितनी एक्टिवेशन की लाइब्रेरीज वगैरह जो
सब मिलती है वो सब आपके पास में है कोई
ऐसी दिक्कत वाली बात नहीं है इसके अंदर
ठीक है जी अब हमें क्या है यह एक्टिवेट
वाली जो स्क्रिप्ट है ना ये स्क्रिप्ट
चलानी होती है चाहे आप
आपको पूरा एक ब्लॉग मिल जाएगा यह सब
अलग-अलग जाके नहीं पढ़ना पड़ेगा एक ही जगह
मैंने सारा पूरा अच्छे से डिटेल में लिख
दिया है डिस्क्रिप्शन चेक कर लेना तो मैक
पे है तो अगर आपको सोर्स ही यूज करना होता
है तो सोर्स से आप इस एनवायरमेंट में बिन
के अंदर जाके एक्टिवेट कर सकते हैं विंडोज
पे है तो सीधा ही डॉट इसके अंदर जाके
स्क्रिप्ट्स एक्टिवेट जाना आपको एक्टिवेट
पे ही है वो आपकी या तो स्क्रिप्ट्स में
होगा या बिन के अंदर होगा जहां पे भी हो
हमें वहीं पे जाना पड़ता है और उसको
एक्टिवेट करना पड़ता है चलिए जी यह भी कर
लेते हैं हम यहां पे तो हमारे पास है
सोर्स और सोर्स के बाद हमें जाना पड़ेगा ड
v एनवी और हमारे पास बिन है और उसके अंदर
एक्टिवेट यही कमांड उन्होंने लिख रखी है
जैसे ये कमांड आप इंस्टॉल करोगे या
एक्टिवेट करोगे अपनी स्क्रिप्ट को तो
हमारे पास में ये लीजिए ओ अ सोर्स ओके
टाइपो छोटा सा
टाइपो ये लीजिए सोर्स ठीक है तो अब मुझे
क्या दिख रहा है यहां पे कि मेरे पास एक
डॉट v एनवी ये मेरी कमांड लाइन पे पहले आ
गया है इसका सिंपल सा मतलब है कि अभी आप
वर्चुअल एनवायरमेंट के अंदर हो और इससे
ज्यादा कुछ भी नहीं है आपको जब भी करना हो
आप डीएक्टिवेट कर सकते हो तो इस तरह से डी
एक्टिवेट लिख दीजिएगा और आपका कमांड मतलब
आपका जो वर्चुअल एनवायरमेंट है वो
डीएक्टिवेट हो जाता है ठीक है जी यह वाली
काम तो हमारे पास आ गई इसको एक बार रीलोड
करवा लेते हैं थोड़ा सा हैंग हो रहा है यह
ओके जी तो हम इसको करते हैं आई थिंक मेरे
मशीन को एक रीस्टार्ट की जरूरत है क्योंकि
काफी दिनों से क्या काफी हफ्तों से
रीस्टार्ट नहीं हुई मशीन ठीक है जी वीडियो
के बात करेंगे अभी चलिए इतना काम तो हो
चुका है हमारे पास में कि सारा इंस्टॉलेशन
वगैरह सब कुछ आ सका है अब एक और छोटी सी
चीज आपको ध्यान रखनी है कि कुछ भी आपको
इंस्टॉल करना है तो इस तरह से करना है
यूवी उसके बाद पिप इंस्टॉल जो भी आपको
इंस्टॉल करना है हमें जंगो इंस्टॉल करना
है तो वो भी हम देखेंगे किस तरह से कर
सकते हैं बट जहां भी आपको बता रखा होगा व
बता रखा होगा पिप या पिप 3 अब आप क्योंकि
वर्चुअल एनवायरमेंट में आ गए हो तो उससे
पहले यूवी लगाना क्योंकि यूवी से हमने
वर्चुअल एनवायरमेंट बनाया है और यूवी पिप
उसके बाद इंस्टॉल और जो भी इंस्टॉल करना
है ठीक है जी यह आपको आ चुका है समझ में
यूवी पेप इंस्टॉल करना है हमें ओके तो हम
चलते हैं अब हमारी दूसरी पे कि अब कैसे
करना है तो यहां यहां पे हमें बोल रखा है
कि जंगो आप इस तरह से इंस्टॉल कर सकते हो
स्पेसिफिक वर्जन है तो वो कर लीजिएगा वरना
जंगो कर सकते हैं करके देखें कैसे होता है
इंस्टॉल चलिए जी करके देखते हैं तो हमें
कहा गया है कि आप यहां पे लिख सकते हो पिप
सॉरी यूवी लिखना है पहले यूवी उसके बाद
पिप पिप थ नहीं अगर मैक पे हो तो भी पिप
ही लिखना है क्योंकि अब आप वर्चुअल
एनवायरमेंट में हो तो वो थ्री वाली
प्रॉब्लम हट चुकी है और इसके बाद आपको
सीधा लिखना है कि आपको यहां से इंस्टॉल
करना है बहुत ही ज्यादा परेशान कर रहा है
कीबोर्ड सिस्टम रीस्टार्ट करना ही पड़ेगा
इंस्टॉल और आपको लिखना है जंगो जंगो का डी
कैपिटल है हां जी जंगो डी से स्टार्ट होता
है तो जैसे ही आप एंटर करोगे जंगो इंस्टॉल
हो जाएगा रिडिक असली फास्ट इंस्टॉल होता
है इससे यूवी से और जो भी डिपेंडेंसीज है
सब डिपेंडेंसीज है वह आपके पास में यहां
पे आ चुकी है ठीक है जी जंगो इंस्टॉल तो
कर
लिया अब इसके बाद क्या करना है अब इसके
बाद ज्यादा कुछ खास है नहीं जंगो को यूज
करके एक प्रोजेक्ट बनाना चाहेंगे अब उससे
पहले थोड़ी सी यहां पे पढ़ लेते हैं कि
जंगो के अंदर और भी आपके तरीके हैं यह सब
है अ बाय द वे इसके अर जो आपको
डॉक्यूमेंटेशन और यह सब मिलेगा ना ये
नेक्स्ट लेवल होता है
python2 लेवल है ये लोग
को और कई बार मैंने उनके साथ इंग्लिश चैनल
पे पॉडकास्ट भी किया है वो भी ये कहते हैं
जब भी बात होती है कि हां हम
pythonanywhere.com
प्रोजेक्ट जब आप बनाते हो कुछ कंफ्यूजन
होने के चांसेस हैं पर नहीं हो गए क्यों
नहीं हो गए छाई और कोड पे आए हो यहां पे
कैसे कंफ्यूजन होगा तो हम क्या करते हैं
अब क्योंकि आपके पास जंगो इंस्टॉल्ड है तो
आप एक्चुअली में अब यहां पे यूज कर सकते
हो अ जंगो ड एडमिन तो यह जो है जंगो एडमिन
ये एक कमांड है जो आपके पास इंस्टॉल हो
जाती है जंगो इंस्टॉल करते ही अब यहां पे
दो-तीन सब कमांड्स आती है एक तो आपके पास
मेन कमांड आ गई है कि जंगो एडमिन यूज करना
है उसके बाद पहली जो कमांड हम सीखेंगे वो
है स्टार्ट प्रोजेक्ट दो कमांड्स होती है
एक स्टार्ट ऐप और एक स्टार्ट प्रोजेक्ट
फर्स्ट टाइम आप प्रोजेक्ट कमांड को यूज़
करते हो इसके बाद कहीं यूज नहीं करते हो
स्टार्ट प्रोजेक्ट इसके बाद जैंगो में
मल्टीपल छोटी-छोटी एप्स बनती है अभी के
लिए सिर्फ प्रोजेक्ट स्टार्ट करना है तो
हम क्या करेंगे वही चाय और
जैंगो ठीक है जी चाय और जैंगो मैंने लिखा
अब एंटर करा तो मेरे पास आ गया है चाय और
जैंगो का प्रोजेक्ट अब सबसे जो कंफ्यूजन
होता है जिसमें लोगों को कि आप जैसे इसको
ओपन करेंगे इसके अंदर एक और फोल्डर होगा
चाय और जैंगो अब आप सोचेंगे सर यहां पे
डॉट लिख देते तो हमारे पास शायद इसी
फोल्डर में आ जाता नहीं नहीं आप ऐसा नहीं
करना चाहते जब भी python2 जंगो का
प्रोजेक्ट बनता है तो उसके अंदर एक सब
फोल्डर इसी तरह से बनना चाहिए मेन
प्रोजेक्ट हमारा इसी तरह से ही आना चाहिए
ये स्टैंडर्ड प्रैक्टिस है कि वर्चुअल
एनवायरमेंट और इसी लेवल पे हमारे पास में
जंगो का प्रोजेक्ट होना चाहिए जो भी आपने
नाम दिया है तो हमारे पास है चाय और जंगो
अब इसके अंदर आपको दिखेगी एक manage.py
फाइल तो सबसे पहला काम है इस फोल्डर के
अंदर जाइए तो यहां से हम चलते हैं चाय और
जंगो के पास ठीक है जी अब जैसे ही मैं एलस
करके देख रहा हूं मुझे manage.py नाम की
फाइल दिख रही है चलिए जी रन करते हैं इसको
तो रन करने का सिंपल सा तरीका है कि
python.py और एक सब कमांड भी हम इसको
देंगे जिसका नाम है हमारे पास में रन
सर्वर जैसे ही आप रन सर्वर कमांड दोगे तो
आपको कुछ यहां पे एरर्स दिखाई देगी इन पे
अभी चिंता नहीं करेंगे आने वाले वीडियोस
में डिटेल में इस पर चर्चा करेंगे कि क्या
है यह एडमिन ऑथ कंटेंट टाइप सेशंस अभी के
लिए इग्नोर करेंगे इस वीडियो में हम नहीं
देखेंगे उसको अब क्या है देखिए यहां पर
क्या है कि आपके पास आया कि वाचिंग फाइल
सर्वर्स चैलेंज सिस्टम चेक्ड आईडेंटिफाई
नो इश्यूज वगैरह सब कुछ आपके पास यहां पे
आया है और साथ में ना आपको यहां पे एक
डीबी एस्कोलाइट भी बनता हुआ दिखाई दे गया
हम तो डीबी एस्लाइट आपके पास बन गया है ओ
मेरे को एक छोटी सी एरर और आई है दैट
पोर्ट इज ऑलरेडी यूजिंग इट तो शायद कहीं
ना कहीं मेरा क्योंकि बड़ा ही कॉमन पोर्ट
है तो आई थिंक रन हो रहा है कहीं ना कहीं
ओहो यस मेरी दूसरी एप्लीकेशन में रन हो
रहा था मैंने उसको स्टॉप कर दिया वापस से
चलाते हैं इस कमांड को क्योंकि मोस्टली जब
मैं जावास्क्रिप्ट के बैक एंड्स बनाता हूं
वो भी 8000 पे ही रन करता हूं और पाइथन भी
हमारा बाय डिफॉल्ट इसी पोर्ट पे रन होता
है बाय द वे इन केस आपके साथ भी ऐसी
सिचुएशन आ जाए कि हमारा जो सर्वर है या
फिर जो डिफॉल्ट पोर्ट है वो अगर ब्लॉक है
तो हां हम ये भी इसका भी सलूशन कर सकते
हैं बड़ा ही आसान है कि आप इसके बाद ना
पोर्ट नंबर दे दीजिए कुछ नहीं देना है और
जैसे सपोज करिए 8001 तो आप 8001 दे
दीजिएगा वो काम भी हो जाएगा अच्छा हुआ एरर
आई एक और सीखी तो अब हम क्या करते हैं
यहां पर सीधा इसको लेकर आते हैं और इसको
रन सर्वर करते हैं ठीक है जी रन सर्वर
किया तो हमें पता लगा कि लोकल होस्ट 8000
पर हमारी बाय डिफॉल्ट पप रन होती है ठीक
है जी हम यहां पर आते हैं और यह लीजिए एक
नए टैब के अंदर यहां पर ओपन करते हैं इसको
तो उप्स यहां पर प्लीज कॉपी कर लीजिए ओके
कॉपी कॉपी
कॉपी वैसे तो डायरेक्ट ही हो जाना चाहिए
था बट आज क्योंकि हमारे कीबोर्ड को कुछ
ज्यादा ही नी है
मुझसे यह हो गई आपकी फर्स्ट जंगो इनका
डार्क मूड अभी तक नहीं आया है बाय डिफॉल्ट
पप में तो यह है आपकी जंगो की एप्लीकेशन
रन हो गई है यहां पे आप इस पेज को इसलिए
दे रख देख रहे हो क्योंकि आपका डीबगिंग
ट्रू है डीबगिंग फाल्स हो जाएगा तो आपको
यह पेज नहीं दिखेगा अब बात आती है कि ठीक
है जी यह तो हमने ऑन कर लिया है जंगो
वगैरह का सब कुछ लेकिन अब बात आती है कि
यह सब आ कहां से रहा है तो हम करेंगे अब
थोड़ा सा फाइल का एक्सप्लोरेशन कि किस तरह
से जंगो वर्क करता है और बस इतना ही नहीं
करेंगे नेक्स्ट वीडियो में और डिटेल में
जाएंगे बट अभी के लिए सिर्फ और सिर्फ फाइल
एक्सप्लोरेशन जरूरी है सबसे पहली फाइल
आपकी manage.py यह आपकी स्टार्टिंग पॉइंट
फाइल है और यही वह फाइल है जो आपके
एनवायरमेंट वेरिएबल से लेके बहुत सारी
चीजें सेट करेगी इनफैक्ट प्रोडक्शन में
जाने के बाद भी यही फाइल है जो आपके
सिस्टम को इवोक करती है मतलब फर्स्ट टाइम
यही फाइल आपकी रन होती है इस फाइल के अंदर
काफी ऑप्शंस आपको अवेलेबल होते हैं जो कि
हम सर्वर पे जाके और भी देखते रहते हैं तो
manage.py एक चीज का और
फोल्डर्स बनाएंगे और आपको पता होना चाहिए
एगजैक्टली उस फोल्डर का इंडेंटेशन कहां पे
है कि वो फोल्डर का लेवल कहां है
manage.py लेवल है इसी तरह से
python2 लेवल जो कि manage.py जिस लेवल पे
है फाइल वहीं पे कुछ फाइल्स या फोल्डर्स
बनाए जाते हैं फ्रेमवर्क है रूल्स उनके
हैं हम हमारी तरफ से ना फाइल्स एंड
फोल्डर्स का नाम रख सकते हैं ना ही हम
अपनी मर्जी से अ कहीं पे भी फाइल्स और
फोल्डर्स को डंप कर सकते हैं स्पेसिफिक
रूल्स है वहां पे आप फाइल्स एंड फोल्डर्स
क्रिएट करोगे तो एक्सपेक्टेड बिहेवियर
मिलता है ठीक है जी फिर हमारे पास आया
एलाइट 3 एलाइट 3 क्यों आया क्योंकि यही
डिफॉल्ट डेटाबेस है जो कि आपको जंगो में
यूज होता है अब सबसे अच्छी बात यह है कि
जो भी कोड आप यहां लिखोगे उसका कोई लेना
देना नहीं है एस्लाइट से माय सीक्वल से
पोस्टग्रेस से आप कभी भी किसी भी मौके पे
सिर्फ कुछ दो-चार लाइनों का कोड लिख के
कोड भी नहीं कहूंगा कॉन्फ़िगरेशन सेट करके
बस ट्रू फॉल्स करके एस्कोलाइट से
पोस्टग्रेस पे मूव कर सकते हो पोस्ट ग्रेस
से माय सीक्वल पे मूव कर सकते हो इनफैक्ट
हां जंगो के अंदर नो सीक्वल डेटा बेसेस भी
काफी अच्छे से चलते हैं बट आम प्रैक्टिसेस
यही है कि हम ज्यादातर सीक्वल डेटा बेसेस
में ही रहते हैं बट आपको सीक्वल डेटा
बेसेस से ज्यादा इंटरेक्ट नहीं करना पड़ता
सीक्वल नहीं लिखते हो आप अब चलते हैं हम
इस फोल्डर के अंदर ये है हमारा प्रोजेक्ट
फोल्डर इस फोल्डर के अंदर काफी बेसिक्स ही
हम करते हैं ज्यादातर हम एक सेपरेट ऐप
बनाते हैं जो हम नेक्स्ट वीडियो में
बनाएंगे और उसके थ्रू काम करते हैं अब
आपको पता ही है अगर आपने
python's फोल्डर है जब भी मल्टीपल मॉड्यूस
होते हैं python's फोल्डर आपके पास बनता
ही बनता है जिससे ऑप्टिमाइजेशन आता है यह
हमने काफी डिस्कस करा था पहले भी उसके बाद
जो सबसे मेन फाइल है जिसके पास आप
कभी-कभार ही जाओगे बट बहुत इंपॉर्टेंट है
वो है settings.py यहां पे जितना भी
कॉन्फ़िगरेशन है पूरे जंगो का वो लिखा हुआ
होता है कि बेस डायरेक्ट्रीएंट्री
यह वाली चीज भी बहुत काम आएगी जैसे मैंने
कहा कि जंगो के अंदर हर चीज एक छोटी-छोटी
एप्स होती है जैसे आप सपोज करिए ई-कॉमर्स
बना रहे हैं तो उसके कूपंस एक छोटी सी अलग
ऐप होगी हालांकि इंटरेक्ट कर सकती है आपस
में कोई दिक्कत वाली बात नहीं है बट कूपंस
को अक्सर एक अलग एप्स बना देते हैं
प्रोडक्ट्स कैटेगरी जो आप लिस्ट कर रहे हो
उसको एक अलग बना देते हैं चेकआउट को एक
अलग ऐप बना देते हैं ताकि मल्टीपल लोग भी
काम कर सके और सेपरेट भी रहे लॉजिक तो वो
हम यहां पे एडिशनल ऐड करते रहते हैं मिडल
वेयर्स भी जंगो के बहुत पावरफुल है इतने
मिडल वेयर्स तो आपको बाय डिफॉल्ट मिलते
हैं जिसमें कि आपका ऑथेंटिकेशन भी है और
क्लिक जैकिंग वगैरह से प्रोटेक्शन भी है
यह सब आपको आउट ऑफ द बॉक्स मिलता है और
बाई द वे ऑथेंटिकेशन पे भी हम डेडिकेटेड
देखेंगे कि कितना बड़ा एडमिन पैनल आपको
बिना कुछ करे ही जंगो के अंदर शिप इन होता
है और बहुत ही अच्छा एडमिन पैनल है उसके
अलावा टेंपलेट्स पे भी हम आएंगे किस तरह
से टेंप्लेट किया जाता है उसके बाद देखिए
यह है हमारा डेटाबेस का सेक्शन अभी हम
एलाइट 3 पे डील कर रहे हैं बट इवेंट
ओबवियस सी बात है पोस्टग्रेस वगैरह पे भी
डील करेंगे हम उसके बाद आपके पासवर्ड के
ऑथेंटिकेशन वैलिडेशन जो भी हैं वो बाय
डिफॉल्ट आपके पास आते हैं अ टाइम जोन
लैंग्वेज कोड यहां पे भी हम आएंगे अभी
नहीं थोड़ा बाद में आएंगे ठीक है जी तो
आपको सेटिंग्स फाइल समझ में आ गई कि हां
अगर प्रोजेक्ट लेवल पे कोई सेटिंग करनी है
तो मैं settings.py फाइल में आके कर सकता
हूं ज्यादा नहीं होता है एक-एक दो-दो लाइन
की सेटिंग्स होती है उन्हीं को बस आप
कॉन्फिन करते हो इसके बाद एक कॉमन फाइल पे
आप जो जाओगे वो होगी urls.py ये आपकी पूरी
राउटिंग की फाइल है कि आप कहां पे जा सकते
हो अब आप यहां देख सकते हो एडमिन ऑलरेडी
एक राउट है बट ये कॉन्फिडो ग तो यहां पे
अभी कुछ आपको खास मिलेगा नहीं उसके लिए
थोड़ा सा एक दो कमांड और चलानी पड़ेगी जो
हम नेक्स्ट वीडियो में चलाएंगे बट हां
एडमिन आपको बाय डिफॉल्ट मिलता है हां जी
पूरा एडमिन डैशबोर्ड यहां पे आके हम पूरे
फाइल्स की राउटिंग करते हैं राउटिंग मतलब
कौन से यूआरएल पे आप जाओगे यूआरएल पे जाने
के बाद होगा क्या वह हम एक सेपरेट फाइल
में डिस्कस करते हैं वो फाइल अभी यहां पे
है नहीं वो फाइल हमें फर्स्ट टाइम बनानी
ही पड़ती है अगर यहां पे है views.py तो
यह view.py हमारे सारे व्यूज डिफाइन करती
है व्यूज मतलब कंट्रोलर समझ सकते हो जितना
भी फंक्शनैलिटी है बिजनेस लॉजिक है वो सब
यहां पे डील करते हैं इसी तरह से मॉडल नाम
की भी फाइल बनती है जो कि
इवेंचर हम सारे डेटाबेस मॉडल्स रखते हैं
तो इस तरह से पूरे जंगो की एप्लीकेशन होती
है पहले सबसे पहले आप ये यूआरएल फाइल को
हिट करते हो मतलब एक यूआरएल हिट करते हो
तो ये जो यूआरएल फाइल है ये गवर्न करती है
कि कौन सा वाला राउट उसको हैंडल करेगा तो
यहां से एक बार राउट हैंडल हो गया फिर
हमारी फाइल का जो पूरा कंट्रोल है वो जाता
है व्यूज के ऊपर व्यूज में आप लिखते हो
बिजनेस लॉजिक और वहां से ही रिटर्न कर
सकते हो आप या तो कोई html5 रिटर्न कर
देते हो या सिर्फ हेलो वर्ल्ड रिटर्न कर
देते हो या जो भी आपको रिटर्न करना है
उसके अलावा डेटाबेस में चीजें किस तरह से
स्ट्रक्चर्ड होगी कैसे रहेगी वो सारा काम
हम models.py नाम की फाइल में करते हैं वो
फाइल्स अभी है नहीं
एवेंचुरा ज्यादा बर्डन नहीं देना चाहता कि
आपको लगे कि बहुत ओवर
वेल्मिनिक पूरा एक्सप्लोर करा है किस तरह
से होती है और अभी के लिए मैं थोड़ा सा
स्टार्टिंग में लाइट र ख रहा हूं उसको
ताकि आपको अच्छा लगे कि हां ठीक है हमने
एटलीस्ट एक प्रोजेक्ट बनाया फाइल
स्ट्रक्चर को समझा कि इतना भी बड़ा फाइल
स्ट्रक्चर नहीं है कि समझ ही नहीं आ रहा
कि क्या हो रहा है तीन-चार फाइलें थी हमने
उनको समझ लिया ज्यादा नहीं एक दो कमांड्स
ही थी वो हमने देख लिया हमारी जंगो की
एप्लीकेशन रन भी है ये जो बोल रहे थे
डीबगिंग ट्रू कहां से आया वो भी हमने एक
बार देख लिया बस दैट स इट अभी के लिए हम
इतना ही करेंगे क्योंकि थोड़ा सा इसको
लाइट वेट रखेंगे और आने वाले वीडियोस के
अंदर हम देखेंगे कि किस तरह से हम और काम
कर सकते हैं इन एप्लीकेशंस के अंदर किस
तरह से हम कस्टम टेंप्लेट कर सकते हैं
स्टैटिक फाइल्स डेटाबेस बहुत कुछ आना बाकी
है आपको जैसा पता है हम प्रोडक्शन लेवल प
लेके ही जाते हैं चीजों को फुल इन डेप्थ
जाते हैं एक्सप्लोर करते हैं अच्छी
प्रैक्टिसेस भी सीखते हैं प्रोडक्शन ग्रेड
चीजें भी सीखते हैं वो भी यहां पे भी हम
करेंगे तो ठीक है कमेंट टारगेट मत भूलिए
और शेयर करिएगा सीरीज को और मिलते हैं
आपसे नेक्स्ट वीडियो के अंदर थोड़ा सा और
ज्यादा कोड लिखेंगे नेक्स्ट वीडियो के
अंदर ठीक है बस चाय बना के रखिए और फटाक
से आए हम नेक्स्ट वीडियो को लेके आपके पास
में सब्सक्राइब कर दीजिएगा तब तक
Посмотреть больше похожих видео
手把手教大家搭建Autogen|微軟的多智能體協作系統|多AI協調|#multi-agent #autogen #openai #chatpgt #gpt4 #gpt #web3
Packages in Java
#2 Python Tutorial for Beginners | Python Installation | PyCharm
#03 💻 Membuat Project Laravel Baru menggunakan Docker Container
Como instalar o Netbeans - 2023
How to Setup the XR Interaction Toolkit - 2023 Unity VR Basics
5.0 / 5 (0 votes)