[Django] #22559: Tutorial 5 - Missing few steps in instruction

6 views
Skip to first unread message

Django

unread,
May 2, 2014, 5:19:13 AM5/2/14
to django-...@googlegroups.com
#22559: Tutorial 5 - Missing few steps in instruction
-------------------------------+------------------------
Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Keywords: Tutorial 5
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------
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()
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22559>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 2, 2014, 5:57:21 AM5/2/14
to django-...@googlegroups.com
#22559: Tutorial 5 - Missing few steps in instruction
-------------------------------+--------------------------------------

Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Resolution:

Keywords: Tutorial 5 | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Briksins@…):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Further problems:

The following code execution:
{{{
response = client.get('/')
}}}
throw exception:

{{{
AttributeError: 'module' object has no attribute 'ROOT_URLCONF'
}}}

not sure how to fix this problem as my "settings.py" file has defined
"ROOT_URLCONF"


{{{
ROOT_URLCONF = 'Tutorial_1.urls'
}}}

cannot continue with that tutorial, moving to the tutorial 6 without
completing that one

--
Ticket URL: <https://code.djangoproject.com/ticket/22559#comment:1>

Django

unread,
May 2, 2014, 6:45:56 AM5/2/14
to django-...@googlegroups.com
#22559: Tutorial 5 - Missing few steps in instruction
-------------------------------+--------------------------------------
Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.6
Severity: Normal | Resolution: invalid

Keywords: Tutorial 5 | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => invalid


Comment:

You need to use `manage.py shell` as described before that section: "We
will start again with the shell".

--
Ticket URL: <https://code.djangoproject.com/ticket/22559#comment:2>

Django

unread,
May 2, 2014, 6:51:50 AM5/2/14
to django-...@googlegroups.com
#22559: Tutorial 5 - Missing few steps in instruction
-------------------------------+--------------------------------------
Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.6
Severity: Normal | Resolution: invalid

Keywords: Tutorial 5 | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by anonymous):

ohh my bad, i used just python command to enter the python shell, not
manage.py shell

--
Ticket URL: <https://code.djangoproject.com/ticket/22559#comment:3>

Reply all
Reply to author
Forward
0 new messages