November 2015
Beginner to intermediate
840 pages
26h 30m
English
We can interact quite powerfully with Django’s ORM in the Python interpreter. This is useful not only because it will help us learn Django on the fly but also because it is a tool we will continue to use throughout our careers in Django. Using the interpreter to test queries as you write them can help speed the development process.
Rather than invoke Python and then import the necessary Django tools, Django provides a shortcut. We can invoke ./manage.py shell, which runs the Python interpreter (or IPython, if you have it installed) and fetches the bare minimum for Django to work. From there we can begin loading in our own project code, as shown in Example 3.39.
Example 3.39: Python Interpreter Code ...
Read now
Unlock full access