Join Caleb Smith for an in-depth discussion in this video Implementing Django templates, part of Learning Python and Django (2015).
- Now that you've been introduced to the…different template tags, let's go ahead…and flush out the templates in our project.…First, let's open our text editor.…The first step is that we need to create our base template.…This will be named base.html and needs to be inside…of the firstdjango folder, inside of the templates folder,…here beside of this inventory folder.…Saving this files as base.html.…You'll want to ensure base is inside of templates,…beside of inventory, where our other template files are.…
Inside of this base.html file,…we'll start with some html boilerplate and structure,…such as the doctype html and head and body tags.…As you can see, this is the html that we'll need…on every page.…Inside of the body tag, we'll add the block content tag…so that we can override it in the child templates…to put our content in.…
This block tag provides a place for child templates…to put their unique body elements.…We've named this block tag content.…Now let's open the index html template…inside of inventory.…Now I'll save the file.…
- Creating a new Django project
- Defining Django models and fields
- Querying data with the Django ORM
- Building views and templates
Skill Level Intermediate
Q: pip says it was installed correctly, and I've updated the PATH variable as shown, but the pip --version command isn't working. Why?
A: Depending on your computer's setup, you'll need to restart your terminal/command prompt before the additions you've made to the PATH variable are respected. With some setups, even that won't be enough, and you may need to restart the entire machine before you are able to use the pip command directly.