In this lesson, you’re going to take another look at your project to see a few of the important files that you’re going to work with a lot:
manage.py: You won’t go inside this file, but it’s kind of the command center of your project, so a lot of commands that you run are going to sit inside this file.
myproject: Inside of the management app, which is the one you start with when you first create your project, there are two files that you’re going to work with.
urls.pyis used to route forward to your other app.
settings.pyhas project-wide settings.
example_app, the projects app you’ll be creating, you’ll have a few files. The most important ones are
All right. Let’s take another look at our bare-bones project to discuss a few of the important files that we’re going to work with a lot. So over here, I mentioned already before, we have
00:23 Inside of our terminal, we’re often going to call this file and then a certain function when we want to perform a Django-wide action. Inside of the management app—so, this is the one that comes when we first create the project—
inside of here, there’s two files that we’re going to touch.
urls.py—we’re going to use this mostly just to route forward to our other app, but we’re going to take a look inside of this one here. And
settings.py has project-wide settings. So, we’ll took a look at what this file looks like.
00:56 There’s a lot of code in here already that comes with Django. We actually don’t have to change too much in here most of the time, but we will come back to this file once in a while and adapt some of the settings when it’s necessary.
we have a couple of files. This is where we will mostly work: inside of our app. The most important files in here will be the
urls file. It will be directing here from
myproject—I’ll talk about this more in the next video.
Then, we’re going to use the
views file. This is where we write our code logic in Django. We’ll also use the
models file. This is where we’ll define how our database table should look like. All right, so those are the most important files:
02:04 So, this was a quick overview of the most important files that we will be working with in our project. Let’s head to the next video where I’ll discuss how does a request flow through a Django app. See you there!
Become a Member to join the conversation.