4.8.1 Using Templates in the Shell

To interact with the system, we return to the Django shell. The shell or terminal can be a little uncomfortable to beginners, but using the shell shortens the code creation feedback loop and is a great tool to learn and use regularly. The alternative would be to create a Python file, add or edit code, run the code, and view the output. By going directly to the shell, we are provided with output far more quickly, allowing us to dabble with code. Furthermore, if we wanted to use the template system in the context of Django, we would be writing views, and that content is reserved for Chapter 5.

As seen in Chapter 3, we can invoke the shell thanks to /manage.py (Example 4.63).

Example 4.63: Shell Code

$ ./manage.py ...

Get Django Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.