In this section, you:
- Created an app called
project
:
(.env)$ python manage.py startapp projects
- Registered your app in
settings.py
:
INSTALLED_APPS = [
# django apps
# my apps
"projects",
]
-
Dug through various URL configurations
-
Created a view function that returns an
HttpResponse
object:
def project_list(request):
return HttpResponse("<h1>Aye!</h1>")
- Changed the view function to render a template instead:
def project_list(request):
return render(request, "projects/index.html")
-
Understood the nested template folder structure in Django
-
Registered your new template folder structure in
settings.py
:
TEMPLATES = [
{
"DIRS": [os.path.join(BASE_DIR, "projects/templates"),]
}
]
- Added Boostrap styling:
<head>
<link rel="stylesheet" href="link-to-boostrap-CDN/bootstrap.css">
</head>
- Made friends with a whole bunch of errors!
In the next section, you’re going to keep working on your projects
app and change it quite significantly. You’re going to introduce models, which are Django’s way on interacting with a database.
Pygator on Oct. 13, 2019
I couldn’t understand what you said for the other kind of view after list view for the projects. But great course and content so far. This is in my top5 for sure of favorites. Hoping there will be more follow on or related video courses.