Python Django Tutorial for Beginners
Python Django Tutorial for Beginners – Learn Django for a career in back-end development. This Django tutorial teaches you everything you need to get started.
– Get the complete Django course (zero to hero):
– Subscribe for more Django tutorials like this:
Other resources:
Python Tutorial for Beginners:
MySQL Tutorial for Beginners:
Want to learn more from me? Check out these links:
– Courses:
– Twitter:
– Facebook:
– Blog:
TABLE OF CONTENT
0:00:00 – Introduction
0:00:58 – Prerequisites
0:01:38 – How to Take this Course
0:02:40 – Getting Started with Django
0:03:19 – What is Django?
0:06:08 – How the Web Works
0:10:32 – Setting Up the Development Environment
0:12:33 – Creating Your First Django Project
0:18:44 – Using the Integrated Terminal in VSCode
0:22:05 – Creating Your First App
0:25:36 – Writing Views
0:27:27 – Mapping URLs to Views
0:32:10 – Using Templates
0:36:19 – Debugging Django Applications in VSCode
0:44:11 – Using Django Debug Toolbar
0:48:37 – Building a Data Model
0:49:21 – Introduction to Date Modeling
0:52:00 – Building an E-Commerce Data Model
0:56:35 – Organizing Models in Apps
#Django #Python
Django is the most popular framework for quickly building production-grade backends with Python. That's why a lot of companies use it and are looking for developers with Django skills. If you know Python and are looking for a career in backend development, you must have Django on your resume.
Get the Ultimate Django course (zero to hero): https://bit.ly/3E7Iq4d
Mosh Can you please upload at least one full course for free ?
how to fix this error Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: ‘C:\Python39\Scripts\pipenv.exe’ -> ‘C:\Python39\Scripts\pipenv.exe.deleteme’ while installing django
L
Is there a discount Voucher for students? 🙂
hahass
The legend is back. ? As a self-taught programmer, your crash courses are always in my starter pack.
Thanks to you I’m now a Frontend Engineer.?
yho
@Fabien o
@G M P I think it’s still nice to have some knowledge in the back-end side even you are a Front-end developer. ?
Very funny thing to say in a vid about a backend framework innit
Hi Mosh, this is awesome, as usual! I plan to enroll in your full course as a monthly subscriber, but just wanted some clarification on the 10 hour course length advertised in the YouTube video vs the 5 hours indicated on your site. Are there other courses that make up this one, or is it just an approximation for how long it would take to complete the 5 hours of video content? Looking forward to more of your course.
To all those coming in and using vscode on windows, when setting your interpreter path, its in C:UsersUser.virtualenvsstorefront-XXXscriptspython , not binpython. Obviously substitute “User” with your username, and “XXX” with your env.
This also doubles up for those looking for the “bin” directory when hes showing where its at in file explorer, its in “scripts”.
Update: it seems for the python virtual env in terminal on vscode there seems to have been an update on windows. Now when you go to select it will show you the name of the virtual env you are trying to select in ()’s so you can be sure. Inside the parentheses will be the name of the folder you started the virtual env in. Pretty cool.
@Abul Hasnat Shohag case closed
Thank you for this!
You a legend! This was driving me nuts
I did this and I’m still not getting that .vscode directory. Would you know whats happening?
Here’s what I did and what worked for me on Windows (took 20mins to resolve ?) : So opening the command palette from View and adding the interpreter path didn’t work for me. Although the PipEnv interpreter was added, the global interpreter was still highlighted. Even the settings.json file wasn’t showing for me at first.
So I closed VS Code and reopened it by navigating to the storefront folder location in cmd (cd) and then ran “code .” command to open the project in vs code. The settings.json file now showed up in the project directory but it was empty so I added this equivalent line for python.pythonPath used by Mosh: “python.defaultInterpreterPath”:”“. When inserting the path to the virtual env interpreter, make sure the you use double backslashes ‘\’ to specify the path eg. “C:\Users\\.virtualenvs\storefront-XXXX\Scripts\python” and save this settings.json file.
Now restart your project in VS Code the same way and open the terminal. If you’re on windows then you’ll might get an error in the terminal that’s something on the lines of “restricted.. “. To solve this I followed what @Abul Hasnat Shohag said: go to Windows Powershell (search powershell on taskbar and run as administrator) and run this line “Set-ExecutionPolicy Unrestricted” enter and then “Y”. now run vscode terminal again. It finally worked from here on and I could run python manage.py runserver to fire up the django server 🙂
Have been waiting for this course for 2 months now since you told us that you are preparing a Django course. This is the only Django course I needed on earth. I really wanted to learn from you alone. Thanks so much Mosh.
The patient dog gets to feast on the fattest bone.
I celebrate you Mosh. Always wanted to get started on programming. I bought tonnes of books and wasted years but could never really get started. Now am on my way to learning thanks to you. I have rediscovered my interest and am enjoying every step!
My first video of yours, your ability to teach this framework in a linear fashion that actually MAKES SENSE cant be found anywhere else. Saved me a bunch of time and hassle for this project I have coming up. Thanks a lot!
Thanks Mosh! You seem to have a talent for hitting the key points just deep enough to enable understanding and experimentation. I’m interested in more info on a comment you make about templates. You mention that nowadays people use Python to return data, not html. Is that because people are now passing data to tools like React, or is there something else happening that I don’t know about.
Hi, I would also like a clarification on Mosh’s comments for templates not being used much
I was stuck at one place for quite sometime , today as a beginner could finally launch Django..Thank you Mosh, great video.
The motivation before getting started, is the best way of teaching and is even easier to understand ☺️ (thank you sir )
great tutorial, really easy to follow along!
I have a quick question though:
when someone says that disadvantage of Django is that it can only process one request at a time… what does that exactly mean?
does that mean that if several users click on a link, some of them might get a slight delay?
For anyone who has complications with installing the debug_toolbar in django:
After the debug_toolbar is added to the `INSTALLED_APPS` inside the `settings.py` file, the url start point has to be configured in the `urls.py` file, as described at 45:35.
However, I had to adapt the way the debug_toolbar is added to the `urlpatterns`, since `import debug_toolbar` showed me an error: `Import “debug_toolbar” could not be resolved`.
I removed the `import debug_toolbar` from the top and changed the path(..)-entry of the `urlpatterns`-array in the following way:
Instead of
`path(‘__debug__/’, include(debug_toolbar.urls))`
I used
`path(‘__debug__/’, include(‘debug_toolbar.urls’))` // Note the single quotation marks, denoting a string object, around the argument of the include(..)-function.
This resolved the issue for me. I assume there was a change in how apps are or can be referenced inside the `urlpatterns`-array, since the installation guide for the toolbar has changed from what is seen in the video to the page I could view, when writing this comment. Good luck, to anyone who ctrl-f’s this comment :D.
I love Mosh’s videos. I have learned Python, Javascript and Html by his videos.
Mosh can you make a video on Flutter please? Because I can’t understand any other tutorials except yours.
Thank you so much for explaining Python Django in a very easy and beautiful way.?It was very interesting?. This tutorial will be very useful for beginners. ?
Sir your courses are really great and crystal clear even a 10 year child can learn programming from your courses. ???
Thanks for your effort in making this premium course and easily available to us.
Also I learned a lot from your python (full course) video. It helped a lot! Thank you?
I am waiting for this course from you sir.finally you are made this.from last one year i am learning the programming languages that are made by you.those are out standing and explanation is beautiful.
Hi, Mosh! This is a great tutorial and I’ve been following you the whole time but I didn’t have an extra directory of .vscode with the settings.json on it. Btw, i’m on Windows 10. What might be the problem? Maybe I skipped something or what? Thanks a lot in advance!
I have same issue and can’t fix it
@Marcelo Ecco I substituted Script for bin, and it did not work. I am still missing the extra directory of VS Code. I’m using Windows 11, but I can’t imagine something this drastic would be a result of that.
check if when you open the terminal in VS Code it is not opening powershell (ps) if so switch to cmd, then it opened the virtual environment even though I didn’t get the extra directory with the settings.json
@Yabets Mengistu yeah, aparently for windows is Script not bin idk. Mine is working and i leave as Script
@Marcelo Ecco I don’t remember how I fix it but, I think I use Script instead of bin
Thanks for this man. I have a few courses that are like 10 hours but they seem a little overwhelming to start with. But I love your stuff. Really gets me up and going. Someday I might actually have a nicer place to live, and a nicer car and better life because of channels like this.
Wish you loads of luck