Review of the Admin3:07 with Lacey Williams Henschel
Take a moment to review what comes pre-built in the Django Admin.
pip install django==1.9 into Workspaces if you have not already.
Before we start customizing, 0:00 let's take a quick second to review what comes prebuilt in the Django admin. 0:02 As you can see we're in workspaces where you should already have Django 1.9 0:08 installed. 0:12 If don't have Django 1.9, and here in a moment you see that you're admin site 0:14 doesn't look like mine, or if you're not working in workspaces, 0:19 you'll need to change directories into learning_site to install Django 1.9. 0:23 So remember that's just cd learning_site, 0:28 and then pip install django==1.9. 0:32 To start our server in work spaces, 0:40 we need to run phyton manage.py runserver, and 0:43 then we have to add these zeros and a colon and 8000 to the end. 0:47 Once we see that our server is running, we can use this little 0:55 eye up here in the corner to click on Port 8000 and load up our website. 0:58 To get to the admin site we just add /admin to the URL. 1:03 Now our first step is to log in. 1:08 Now, in order for us to log in successfully, 1:14 remember we have to create a superuser. 1:16 So let's exit out of the server by hitting Ctrl+C, and 1:19 then do python manage.py createsuperuser. 1:24 For my username I'm just gonna use my first name. 1:31 I'll put in my email address. 1:34 And then I'll create my password, which I'll have to type twice. 1:38 Now we can start our server again, and see if we can log in. 1:42 All right and here we are. 1:49 Now, if you've used the admin before in Django 1.8 or below, 1:51 the admin site looks a little bit different in Django 1.9. 1:55 All of the functionality is the same, but as you can see, 1:59 the look and feel of the administration side is a little bit different. 2:03 So, for example, on the detail page, so if we click though to courses, 2:07 and click on a particular course, the save button is now in all caps, and 2:12 it's set apart since it's the option that you will be selecting most often. 2:16 But you still have the options to save and add another, or save and continue editing. 2:21 The links underneath courses and 2:27 on the detail page should look familiar to you from Django basics and Django forms. 2:28 Remember, that the fields in the admin come directly from the models that you 2:34 register with the admin. 2:38 Once you register a model with the admin, like our course model, 2:40 you can use the admin instead of the console to add new courses or 2:44 make changes to existing courses. 2:48 Those changes then show up on your website. 2:50 I hope this quick review of the Django admin and 2:54 the way it works has refreshed your memory. 2:57 Now that you remember the basics of the admin, 3:00 let's dive into some simple customizations after a little quiz. 3:02 [BLANK AUDIO] 3:06
You need to sign up for Treehouse in order to download course files.Sign up