O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required