Starting the Project2:18 with Kenneth Love
Now that we have Django installed and we know what we're going to make, let's actually get some code out.
django-admin.py startproject learning_site or
django-admin startproject learning_site will get the project started. We won't need
django-admin again for the rest of our work in this course.
When we installed Django, it installed a handy command line tool for 0:00 us called Django admin, so django-admin. 0:04 We'll use this tool to start our project. 0:08 I wanna name the project something somewhat generic though, 0:10 because there's always a chance that I'll wanna package this up and 0:12 distribute it for other Django developers to use in the future. 0:15 Maybe we'll make the perfect pluggable learning application, you never know. 0:18 So I'm gonna name it learning_site, so we're gonna say django-admin and 0:22 we're gonna say, startproject and then learning_site. 0:27 So since this is a python module, we want to be sure and use an underscore and 0:31 not a hyphen. 0:35 So let's run that, we don't get any feed back. 0:37 Which is actually good, generally no feedback means that things worked. 0:40 So if I come over here and I refresh the file tree, and 0:43 we don't need the thing right there for right now. 0:46 Then I see that we have learning_site inside there, 0:50 we have this other thing called learning_site, and we have a manage.py. 0:53 So let's find out what all we have in here. 0:57 So we have this manage.py, this is kind of like Django admin, 1:00 we're gonna use this to run commands for our project. 1:04 When we need to make a new application, or migrate a database, or 1:08 anything like that, manage.py is our entry point. 1:11 Then we have a second directory here named learning_site, 1:14 I usually refer to this as being a stub. 1:17 Different Django developers call it different things, to me it's a stub. 1:19 Because it's not an app, like we're gonna get to later, but it's similar to an app. 1:24 We haven't talked about what a Django app is yet, so don't worry about that word. 1:28 Anyway, so this one holds the settings.py which is where all of our settings are. 1:34 And it holds the urls.py which is the base URLs for our entire project. 1:39 It has this wsgi, wsgi.py, and 1:45 that controls how our project is served if we put this up somewhere like Heroku, or 1:49 AWS, or whatever, wsgi.py is our entry point from our web server. 1:54 We're not gonna be messing with wsgi.py in this course, but the other things, 2:00 we will be editing. 2:03 All right, well that was a lot of talking about Django and 2:05 just a brief bit of exploring. 2:07 I bet you're ready to actually do something serious. 2:09 Feel free to poke around in the files that start project generator for us. 2:11 In the next stage we'll run the Django server and start our first app. 2:15
You need to sign up for Treehouse in order to download course files.Sign up