Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango_cms ImproperlyConfigured: Error importing middleware cms.middleware.media
    primarykey
    data
    text
    <p>I'm moving an application that uses django_cms from one server, where everything worked, to another and have spent the last 4 hours trying to find the cause of this error. A suggestions very welcome!</p> <pre><code> mod_wsgi (pid=21972): Exception occurred within WSGI script '/var/www/vhosts/compdoctest.com/django/compdoc/django.wsgi'. Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 230, in __call__ self.load_middleware() File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 42, in load_middleware raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) ImproperlyConfigured: Error importing middleware cms.middleware.media: "No module named media" </code></pre> <p>The offending line is the last one in the middleware list in settings.py</p> <pre><code>MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.multilingual.MultilingualURLMiddleware', 'cms.middleware.media.PlaceholderMediaMiddleware', ) </code></pre> <p>If I remove the final line then the code continues and falls over later saying that item is required in middleware.</p> <p>I'm using slightly different version of django, 1.2.1 final on the old working server and 1.2.3 final on the new server.</p> <p>All the things I've tried:</p> <ul> <li>The same version of django_cms - 2.1.0 beta 3 - that was used on the old server</li> <li>The latest version on github - 2.1.0.beta2-550 Putting the cms, mptt, menus, publisher folders in the</li> <li>app From python importing the</li> <li>googled (nobody having the same problem that I can find)</li> <li>middleware file directly (no problem)</li> </ul> <p>result of opening in python:</p> <pre><code>python manage.py shell Python 2.5.2 (r252:60911, Jan 20 2010, 23:14:04) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) &gt;&gt;&gt; import cms.middleware.media &gt;&gt;&gt; cms.middleware.media.__file__ '/var/www/vhosts/compdoctest.com/django/compdoc/cms/middleware/media.pyc' &gt;&gt;&gt; from django.forms.widgets import Media &gt;&gt;&gt; import cms.middleware.media &gt;&gt;&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload