bad django conf example

Bug #1310815 reported by Thomas Capricelli
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Won't Fix
Low
Gabriel Hurley
openstack-manuals
Fix Released
Medium
Darren Chan

Bug Description

With Django 1.6, the setting is wrong. You need to use

SESSION_ENGINE = 'django.contrib.sessions.backends.db'

as described on:

https://docs.djangoproject.com/en/1.6/ref/settings/#std:setting-SESSION_ENGINE

If i use the one described on this page (SESSION_ENGINE = 'django.core.cache.backends.db.DatabaseCache'), i got a 500 error and i have this in logs:

  File ".../django-1.6/django/core/handlers/base.py", line 90, in get_response
    response = middleware_method(request)

  File ".../django-1.6/django/contrib/sessions/middleware.py", line 10, in process_request
    engine = import_module(settings.SESSION_ENGINE)

  File ".../django-1.6/django/utils/importlib.py", line 40, in import_module
    __import__(name)

ImportError: No module named DatabaseCache

greetings,
Thomas

-----------------------------------
Built: 2014-04-07T07:45:00 00:00
git SHA: b7557a0bb682410c86f8022eb07980840d82c8cf
URL: http://docs.openstack.org/havana/install-guide/install/apt/content/dashboard-session-database.html
source File: file:/home/jenkins/workspace/openstack-install-deploy-guide-ubuntu/doc/common/section_dashboard_sessions.xml
xml:id: dashboard-session-database

Revision history for this message
Tom Fifield (fifieldt) wrote :

which version of ubuntu are your running?

Changed in openstack-manuals:
status: New → Incomplete
Revision history for this message
Thomas Capricelli (orzelf) wrote :

I don't use ubuntu.

The bug report is about Django, I don't think ubuntu patched django in such a profound way (using a cache backend for a session engine).

Revision history for this message
Tom Fifield (fifieldt) wrote :

Hi Thomas, I just made that assumption as you came here from an ubuntu version of the install guide :)

Which distro are you running?

I'm asking this question to determine whether the packagages are using django 1.6, to assess the priority this bug should be triaged at.

Revision history for this message
Thomas Capricelli (orzelf) wrote :

I'm using gentoo. There's no doc about installing openstack on gentoo, so i took the ubuntu one, this is the distribution i'm most familiar with among those in the openstack documentation.

Revision history for this message
Tom Fifield (fifieldt) wrote :

Also affects horizon.

openstack/horizon doc/source/topics/deployment.rst

Revision history for this message
Tom Fifield (fifieldt) wrote :

12.04 - not django 1.6
14.04 - django 1.6

Tom Fifield (fifieldt)
Changed in openstack-manuals:
milestone: none → juno
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Andreas Jaeger (jaegerandi) wrote :

Note that horizon's file openstack_dashboard/local/local_settings.py.example does not include SESSION_ENGINE at all.

Revision history for this message
Thomas Capricelli (orzelf) wrote :

The bug is not specific to django1.6, this configuration stuff hasn't changed for very long :

https://docs.djangoproject.com/en/1.2/ref/settings/#session-engine

Revision history for this message
Matthias Runge (mrunge) wrote :

Session engine is defined here:

https://github.com/openstack/horizon/blob/master/openstack_dashboard/settings.py#L165

So, there must be something else going on in your installation.

Revision history for this message
Andreas Jaeger (jaegerandi) wrote :

Matthias, what's the way to update the SESSION_ENGINE variable? See step 6 of http://docs.openstack.org/havana/install-guide/install/apt/content/dashboard-session-database.html.

Should SESSION_ENGINE get *added* to local_settings.py? Right now the document implies to change the SESSION_ENGINE variable...

Revision history for this message
Matthias Runge (mrunge) wrote :

Andreas, Thomas,

so, yes: when changing the session engine, I'd change local_settings, since that's a local configuration. But I'd like to see that documented vs. adding this as setting to local_settings.py.example

No question, docs should be improved, esp. deployment docs.

Revision history for this message
Thomas Capricelli (orzelf) wrote :

answer to comment #9 : yes, of course i've changed my local_settings.py as said in the documentation page in reference, that's how the pb happened at first.

answer to comment #10 : i think the proper fix is to just change
http://docs.openstack.org/havana/install-guide/install/apt/content/dashboard-session-database.html

and replace the line
SESSION_ENGINE = 'django.core.cache.backends.db.DatabaseCache'
by
SESSION_ENGINE = 'django.contrib.sessions.backends.db'

Changed in horizon:
importance: Undecided → Low
tags: added: documentation
Changed in horizon:
status: New → Confirmed
Darren Chan (dazzachan)
Changed in openstack-manuals:
assignee: nobody → Darren Chan (dazzachan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-manuals (master)

Fix proposed to branch: master
Review: https://review.openstack.org/119980

Changed in openstack-manuals:
status: Triaged → In Progress
Revision history for this message
Darren Chan (dazzachan) wrote :

Hi there,

This bug addresses Havana documentation. Is it also applicable for Icehouse and Juno?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-manuals (master)

Reviewed: https://review.openstack.org/119980
Committed: https://git.openstack.org/cgit/openstack/openstack-manuals/commit/?id=d5a92e28ef8f85012eced9d08d0c2592771da4bc
Submitter: Jenkins
Branch: master

commit d5a92e28ef8f85012eced9d08d0c2592771da4bc
Author: darrenchan <email address hidden>
Date: Tue Sep 9 13:30:24 2014 +1000

    Minor fix to Django settings in dashboard database session section

    Minor fix to Django settings in the local_settings file

    Change-Id: Ie38e154f20c2ad77e5860fef7c0e7688d3c75809
    backport: havana
    Closes-Bug: #1310815

Changed in openstack-manuals:
status: In Progress → Fix Released
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

The fix for openstack-manuals is the only applicable fix for this, I believe. Closing as wontfix on the Horizon side since there's no change needed.

Changed in horizon:
status: Confirmed → Won't Fix
assignee: nobody → Gabriel Hurley (gabriel-hurley)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-manuals 15.0.0

This issue was fixed in the openstack/openstack-manuals 15.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.