Video: How to Install Django on Windows and Macintosh
Below the video you’ll also find the transcript and Links to jump directly to the correct part in the video
Transcript of the video above:
How to Install Django on Windows Step-by-Step
Jump to video part
This is for Windows 10 here and of course you’re going to need python so if you want to check to see if you have Python.
Hopefully you’ve been watching my learning program series which this is a continuation off and in that situation you have Python installed.
But if you want to check anyway what you want to do is you want to open up your command prompt this guy over here and you want to type in Python with a space dash dash <version>.
And hopefully you’ll see python3.4 and it’s probably best to keep python 3.4 specifically on windows because there are zero problems if you use 3.4 but if you get 3.5 a chance it should work as well as any other later versions of Python.
However if you do not have Python installed you’re going to want to go to python.org/getit/windows and you’re going to want to click on the x86 MSI installer.
And whenever you do that it’s going to install. And you’re going to click next whole bunch times and agree to a whole bunch of things and Python will be installed for you.
Specifically Python will more than likely be in your main c directory and it should be in a directory called python3.4 like you see right here.
And then what you want to do is there’s an option to automatically have Python added to your path. But sometimes that doesn’t take for some reason. So what you want to do is go over into your little start window and type in „control panel“ and click on „control panel“.
Whenever you do „control panel“ is going to open up and your going to want to click on „system and security“. Then after that you’re going to want to click on „system“. Then after that come over to „advanced system settings“ and click on that. When this guy’s gonna pop up you’re going to come down here to „environment variables“ and click on that and then you are going to come to your path right here and click on „edit“. And whenever you do – if it properly installed to your path when you install Python – you’re going to see this guy right here.
If it did not you’re going to want to come in here and say „edit“ and then put that option in and then hit „ok“ and save it and everything should be working fine now.
We’re going to close all of that stuff up and then what you want to do is you want to install pip.
So you’re just going to go into your command prompt again and type in „Python-M pipinstall -Usefacepicright“ like that. And if it doesn’t come up and say that it’s already installed it is going to install it for you and you will have pip all ready to go.
After you have that all set up what we’re going to do is create a Python virtual environment so we don’t have to worry about changing dependencies that your system may not want edited. So inside of your command prompt again you’re going to type in „pip install virtual environment“ just like that and all that will be all set up for you.
Now you’re going to want to come in here and create the virtual environment for your site in your command prompt and to do that again you’re going to type in virtual environment with a space and it normally starts off with env some people just type in env but I normally type in env with a space and then whatever I want my site to be called and just to keep this simple i typed in sight one and then you hit enter and that will be set up for it.
Now you’re going to want to activate the environment in your command prompt and to do that you’re going to want to change to your env underscore site or whatever you called it in to that specific directory and then I hit dir and you’re going to see all of these different guys right here and scripts is where we’re going to be going to next you’re going to want to change directory to scripts and then inside of the scripts directory you’re going to type in activate and hit enter and you’re going to see now we are in a virtual environment that’s what this got red means right here now what we want to do is go and install django and your command prompt again and to do so you’re just going to type in pit with space install django and everything’s going to set up for you and then you’re going to want to test that it works and the test that works you’re just going to type in Python and hit enter and then inside of here whenever these little dashes pop-up you’re gonna want to type in import space django and then django dot get underscore version and don’t forget the parentheses and whatever you do that you should see 1.10.2 or a number higher than that and if you do that you’re going to know that Django’s been installed so then you can just type in quit with two parentheses just like you see right here to exit out of the Python console now what we’re going to do is to create a sample site so I’m just going to jump backwards in our directory so i’m going to type in CD with two dashes right that and you’re going to type in django dash admin start project and then whatever you want your site to be called and come down here you’re going to see sample site as been created right there we are then going to change into the sample site directory and if you hit dir inside of there you’re going to see all this stuff pop up inside of here now sample site which is going to be another directory inside of the sample site directory is going to be where your project is going to be living
manage.PY is actually going to allow you to interact with your project.
We’re going to start our server here in a second with that you’re going to see exactly how that works and then if we go into that sample site directory you’re going to see a couple other additional files will get more specifically into these files later on but basically this guy right here this in net is just going to tell python that this is a Python package and settings which is this guy up here has all the settings for your django project URLs.PY is sort of a table contents for your project and then wsgi.PY is going to serve your project and we’ll get into all of these guys in detail pretty much in the next tutorial so now all you need to do after you have all that setup is to start your server you’re going to want to jump backwards into the sample site directory we have right here and specifically you’re looking for manage that py and you start server you’re going to type in Python manage.py runserver and if nothing goes wrong don’t worry about any of these migration things and all that stuff right here we’re just checking to make sure everything is all set up and if you do so it’s going to tell you the localhost this is localhost 127 thought 0 dot 0 dot one that is localhost on every single computer and then you’re just going to want to open up your browser to this specific address where you can just type in localhost colon 8080 browser and if you do you’re going to see it worked and there you go and you can see right here it says localhost colon 8080 so that is how to setup a django on windows and the next part of the tutorial will start creating web applications.
How to Install Django on Macintosh
Jump to video part
When you setup Django on a Macintosh chances are you’re going to have numerous different versions of Python running inside of this guy so what we’re going to do here is we are going to check or Python version so we’re just going to type in Python dash dash version just like for you can see here that I have python 2.7 pops up inside of there and if you have python3 installed your instead going to type in Python 3 dash version and if that shows up all perfectly fine and you don’t need to install Python otherwise you’re going to have to jump over to the Pythons tight and install it and you’re going to need at least python 3.4 or Python five now to be safe back and I know for a fact i can use Python
Congratulations on your first django powered page!
Please leave your questions and comments below and share this tutorial with your friends and colleges on the social sites of your choice.
Copyright by Derek Banas. All credits go to https://www.youtube.com/channel/UCwRXb5dUK4cvsHbx-rGzSgw