#22559 closed Uncategorized (invalid)
Tutorial 5 - Missing few steps in instruction
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.6 |
Severity: | Normal | Keywords: | Tutorial 5 |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
DJango v1.6.4
Problem:
In the Tutorial 5 - at the begining of the "Test View" part
we have pythin console code to execute:
>>> from django.test.utils import setup_test_environment >>> setup_test_environment()
however import of "setup_test_environment" doesnt work and throw exception:
django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before acces sing settings.
however to execute
settings.configure()
we have to import "settings"
from django.conf import settings
Solution:
To fix tutorial flow need to change current console code of 2 lines to the 4 lines like this:
>>> from django.conf import settings >>> settings.configure() >>> from django.test.utils import setup_test_environment >>> setup_test_environment()
Change History (3)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
You need to use manage.py shell
as described before that section: "We will start again with the shell".
comment:3 by , 11 years ago
ohh my bad, i used just python command to enter the python shell, not manage.py shell
Further problems:
The following code execution:
throw exception:
not sure how to fix this problem as my "settings.py" file has defined "ROOT_URLCONF"
cannot continue with that tutorial, moving to the tutorial 6 without completing that one