Bug 828632 - cobbler-web can't find django.contrib.csrf.middleware
Summary: cobbler-web can't find django.contrib.csrf.middleware
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cobbler
Version: 17
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: James C.
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 832474 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-05 05:16 UTC by Pete Travis
Modified: 2012-06-16 15:09 UTC (History)
5 users (show)

Fixed In Version: 2.2.3-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-06 12:35:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pete Travis 2012-06-05 05:16:42 UTC
Description of problem:
Attempts to access a minimally configured instance of cobbler-web fail. The httpd error_log reports a failure to import a django-provided python module:

[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183] mod_wsgi (pid=638): Exception occurred processing WSGI script '/usr/share/cobbler/web/cobbler.wsgi'.
[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183] Traceback (most recent call last):
[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183]   File "/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183]     self.load_middleware()
[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183]   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Mon Jun 04 20:51:02 2012] [error] [client 10.0.0.183] ImproperlyConfigured: Error importing middleware django.contrib.csrf.middleware: "No module named csrf.middleware"



Version-Release number of selected component (if applicable):

Name        : cobbler
Version     : 2.2.2
Release     : 1.fc17

Name        : cobbler-web
Version     : 2.2.2
Release     : 1.fc17

Name        : Django
Version     : 1.4
Release     : 1.fc17


Steps to Reproduce:
1. Install cobbler, cobbler-web
2. Configure cobbler
3. Access http://example.com/cobbler_web
  
Actual results:

httpd reports server error, fail to load required module.

Expected results:
cobbler-web can find django.contrib.csrf.middleware

Additional info:
This module was moved/renamed:
editing the MIDDLEWARE_CLASSES section of /usr/share/cobbler/web/settings.py to replace 'django.contrib.csrf.middleware.CsrfMiddleware' with 'django.middleware.csrf.CsrfViewMiddleware' will resolve this issue.

Comment 1 James C. 2012-06-06 12:35:40 UTC
This should be resolved in the current release, 2.2.3-1. As part of the new CSRF implementation, there's a conditional in the settings.py file to use the correct CSRF django library based on the django version installed.

Comment 2 James C. 2012-06-16 15:09:39 UTC
*** Bug 832474 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.