Django tip

If you want to use the django.test.client.Client class inside the interactive interpreter to test your views, you need to do the following first:

>>> from django.test.utils import setup_test_environment
>>> setup_test_environment()

If you don’t, you will be able to use Client(), but the properties context and template will always return None.

About these ads