Placeholder Image

Subtitles section Play video

  • Hey, and welcome to the tri Django Siri's.

  • My goal for this one is to help you learn and Master Django like I want you to go as far as you possibly want to go.

  • And understanding the jangle Web framework you see in the way we're gonna do this in this one is really Start from the beginning, we're gonna start with absolute basics and then we're gonna work our way up introducing new concepts along the way.

  • And I'm actually not gonna be building a full project.

  • So instead, what I'm gonna do is just jump into individual concepts, put them into a practical use case in a sort of project, and then eventually you'll have a very good understanding of how to build riel Web applications using Django.

  • And of course, I do recommend that you learn from entire projects and I have a bunch of them both right here on YouTube, on joints.

  • If he dot com slash YouTube as well as on our website joints heavy dot com, we have a tonic stuff there from building riel things with Django.

  • But this series is all about getting the absolute basics to even advanced level things bit by bit.

  • If you're learning Django for the first time, it's an incredibly exciting experience.

  • At least it was for me because once I was able to actually build a Web application with a database attached to it, it was like, Oh, this is so cool.

  • Now I think that you might be just as excited.

  • And perhaps you've already done that with other Web applications.

  • Or perhaps this is the first time your programming.

  • Either way, the most frustrating part is at the beginning, not so much because of the programming language, but often because of how to actually set up your system.

  • And since it's so frustrating over years, we were find the way to set up your system, depending on what you're on.

  • And that's part of the frustration is like you're gonna see me working a lot in a Mac so Mac OS environment, and if you're on Windows, you're like, Hey, why isn't it the same?

  • I mean, actually, using python and actually using Django is the same on both systems.

  • Because Python is python and Django is jangle.

  • The commands to get there might differ slightly, but realistically it's the same over years we've refined the installation process, and all of that could be found on joint safety dot com slash from zero.

  • So if you just do that step one that set up process, you'll be ready for the rest of the Siri's.

  • You don't have to go on to any other step other than setting up your system before you jump there.

  • I did want to mention one other thing, and that is the code.

  • So we have all of our code on get hub or joints.

  • If he dot com slash get hub to shortcut it, you're gonna look for the tri Django depository.

  • So So join TV Dotcom Such get help will take you here.

  • And then if you go into repositories, you'll see all kinds of them.

  • And in fact, if you type out, try Django.

  • You'll see multiple there as well.

  • I want you to ignore all of the ones that have numbers in them and just go to the one try Django, right?

  • So there's a link right here if you want to go directly there, but this code will 100% help you because when you hit roadblocks, which gonna want to do is take the code that you've been writing and take a look at Get Hub and make sure that what you've been writing is the same as what we've been doing in the videos.

  • That part is critical.

  • And then the last thing is, when in doubt, consult the documentation.

  • Jangles documentation is very well written, and there's just so much there that you can learn that we won't necessarily cover because they give additional context.

  • Or they give specifics to whatever use case you have for the technology.

  • And then the last thing is, Google is your friend.

  • You know you can use Google to do a search for something that you're not familiar with, and oftentimes that will bring up stack overflow dot com.

  • Stack Overflow has all of these questions from people for all sorts of programming languages, including python, including Django, including JavaScript, all sorts of things in there, and you just do a quick search.

  • You can search for just jango, and you can learn a lot just from that just from going toe like votes.

  • I mean, does Django scale?

  • That's an interesting question to take a look at, and then what is know what is blank.

  • I mean, this right here is a great learning resource as well.

  • So what I'm gonna assume for the next video and all the other future videos is that you have your system set up and ready to work with Django and Python.

  • The versions that we're gonna be using will be discussed in the next one because they will change over time.

  • At the end of the day, I really want you to stick with whatever version is in the video, because as a beginner, that is critical.

  • All right.

  • So in this one, we're gonna be creating a brand new virtual environment and install Django.

  • If you haven't done these things before, regardless of the version, definitely stop now and make sure you go back and do the setup process.

  • No, I absolutely want you to have a fresh virtual environment and a fresh Django install, not on Lee, just to get the practice of it, but also to make sure that we're all starting from the exact same spot.

  • So if you open up your terminal window or if you're on windows, your power shell or command prompt.

  • But hopefully you're using power shelf on Windows limits and Mac users.

  • Justa terminal is fine, So if we type out Python V and Python three Dash V, this is what I get now.

  • You might already have Python three in there.

  • So if you see Python 3.6 point five or 3.6 point six right here, you're in good shape.

  • If you see this, then you're gonna have to do an extra step, okay?

  • Just keep that in mind.

  • I believe that open.

  • And I'm just gonna put it over to the side a little bit and break it down so we can just keep that in mind while we're doing this.

  • Okay, so I've got another terminal window open now.

  • You absolutely don't have to do this, but I'm gonna leave it there just in case.

  • So there's a few different ways on how we can create a virtual environment and installed Django.

  • I'm gonna show you the way that I'm going to do it so initially, gonna serve you the final way.

  • And if that part works for you, great.

  • You can go to the next portion which would be installing Django, which maybe we should just do all of that and at first, so I'm gonna show you exactly how I'm gonna do it.

  • Now, I first of all, want to keep this virtual environment in one development area.

  • So for me, when I open it up and a list everything out, this is what I see.

  • Yours might be a little different.

  • Years might be the same.

  • You might see this dead folder if you don't see it just to make their dev right.

  • So, in my case, already have it there.

  • So I get this error.

  • I'm gonna just CD into my dad folder.

  • Right.

  • This is where I keep all of my development projects.

  • So in here, I'm gonna go ahead and make a directory called Trying Django.

  • We're a CD into that directory, and then we're gonna create are virtually envy.

  • Now, before it created, I'm just gonna hit virtually envy and make sure I don't see any errors.

  • I see that there's all sorts of options I could do if I type out ABC, there is an air.

  • So if you see an error, that means you need to install your virtual environment all over again.

  • Okay, so I cleared everything out.

  • But if I do pwd?

  • I see exactly where I am.

  • I'm inside of that folder.

  • If I list everything out, there's nothing in there.

  • Now all I'm gonna do is virtually envy.

  • Dash P.

  • Python three Enter again.

  • Remember how I said if you had Python Dash V and Python three was here, you could just omit this portion right here.

  • Right?

  • So if you see Python 3.6 right there, you can admit that portion and just leave it as virtually envy period we had enter.

  • That creates a virtual environment inside of this directory so I can activate it with source been slashed, activate and then install Django.

  • So Pip installed Jango and my version of Django is going to be 2.0 point seven.

  • So Django equals equals 2.0 point seven.

  • That should also be your version of jingle.

  • If you're sticking with me on this, use that version of jingle.

  • I honestly don't care if 2.8 was 2.0 point eight is out used to 0.0 point seven.

  • We'll upgrade things later.

  • And if you stick with me on this, you will absolutely upgrade with us.

  • I promise.

  • Absolutely Promise Okay, so you hit.

  • Enter, and I'm gonna let that run.

  • Now.

  • For those of you on windows, you're activate.

  • You might remember, is different.

  • It's just slightly different.

  • Well, that installs.

  • I'm gonna just go ahead and break it down a little bit.

  • I'm gonna open up another terminal window and simulate reactivating this virtual environment.

  • So list everything out my CD into death, and then I see the into try Django.

  • I'm back into that virtual environment so I could do source.

  • Baines slash Activate in a mac environment, the window's environment, of course, it's scripts us activate.

  • And then you can also run.

  • Deactivate.

  • Okay, so deactivate just ends the virtual environment.

  • Cool.

  • So what is the purpose of having a virtual environment if you don't already know?

  • It is a simple is doing.

  • Pip.

  • Freeze.

  • You see all this stuff?

  • I see.

  • Django 1.10 point four.

  • If I activate it, sore spending, activate and dupe it.

  • Freeze.

  • All I see is Django 2.0 point seven and P Y T c.

  • That's it.

  • So it keeps these requirements separate.

  • And when it comes to Python and its projects like Django, you want him absolutely.

  • Make sure that that is done.

  • Okay, so we have everything installed.

  • If if this part was done, you're ready to go.

  • You could move on to the next one if you had some issues, or you want to see other ways of starting a virtual environment Stick with me.

  • So notice that obviously, we had all this stuff installed, all that's working.

  • So going forward, just just watch.

  • Just for illustration purposes.

  • You know, I'm assuming that up to this point, if you have it working, then you're done.

  • If you don't have it working, watch this next part rewind and then install the things you need to install because I'm going to go pretty fast, but still explain what's going on.

  • Okay, so I'm gonna close out all of my terminal windows and act like I'm starting from zero.

  • Okay, so I jump in to my terminal window I go into I'm gonna go ahead and make a new debt folder called Deaf to a CD into Deaf, too.

  • And list everything out.

  • Nothing's in there so much.

  • I'm gonna show you three different ways and creating a virtual environment.

  • The 1st 1 is just type out virtually envy and then the name that you want to give it so v e N v.

  • That is a way to do it now.

  • This is irregardless of the Python version.

  • It's gonna go off of whatever the system's default version is, so I typed it out.

  • In my case, it's version 2.7, but that is a way to start a virtual environment.

  • Now, if I want to start it based off of a specific version of Python, I would do virtually N v V and V Dash P python for free.

  • Also, it's called V and B to this gives me a version of python and this python three.

  • So that assumes that if I type out python three, it actually gives me a python three.

  • But if you type out Python three and that doesn't work, this won't work.

  • So what happens then?

  • Well, I can just do which python three or, in other words, find the location where Python three is installed, right?

  • So which Python three will not work if Python three doesn't work right, so every once in a while that you installed python in your system and it's just installed somewhere else and this command itself doesn't work.

  • But wherever that is actually installed on any system and you do something like this, you actually paste in the path to that and hit Enter.

  • That should actually open up Python 34 U.

  • S.

  • So then that means that the final way to actually start a virtual environment is virtually n v v E N v three p.

  • And then the path to that python three I hit enter, and then we'll actually start that virtual environment as well.