error .... No module named mediathread.settings_produciton

24 views
Skip to first unread message

John wallace

unread,
Feb 12, 2014, 3:10:46 PM2/12/14
to media...@googlegroups.com
Hi,

Has anyone else seen "No module named mediathread.settings_production"  error?

The details are below .... 


root@mediathread2014:/var/log/apache2/mediathread# more error.log 
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1] mod_wsgi (pid=14280): Exception occurred proc
essing WSGI script '/var/www/mediathread/apache/django.wsgi'.
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/ve/lib/python2.7
/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]     self.load_middleware()
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/ve/lib/python2.7
/site-packages/django/core/handlers/base.py", line 39, in load_middleware
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]     for middleware_path in settings.MIDDLEWAR
E_CLASSES:
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/ve/lib/python2.7
/site-packages/django/utils/functional.py", line 184, in inner
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]     self._setup()
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/ve/lib/python2.7
/site-packages/django/conf/__init__.py", line 42, in _setup
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]     self._wrapped = Settings(settings_module)
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]   File "/var/www/mediathread/ve/lib/python2.7
/site-packages/django/conf/__init__.py", line 95, in __init__
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1]     raise ImportError("Could not import setti
ngs '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
[Wed Feb 12 13:59:36 2014] [error] [client 127.0.0.1] ImportError: Could not import settings 'media
thread.settings_production' (Is it on sys.path?): No module named mediathread.settings_production
root@mediathread2014:/var/log/apache2/mediathread# locate thread.settings_production
root@mediathread2014:/var/log/apache2/mediathread# updatedb &
[1] 14417
root@mediathread2014:/var/log/apache2/mediathread# locate settings_production
/var/www/mediathread/mediathread/settings_production.py


thanks

-John Wallace



Susan Dreher

unread,
Feb 12, 2014, 3:14:06 PM2/12/14
to media...@googlegroups.com
Hi John - 

The mediathread/mediathread/settings_production.py file is referenced in the production apache/django.wsgi. Is the server able to see this file?

Cheers,
Susan


--
You received this message because you are subscribed to the Google Groups "Mediathread" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediathread...@googlegroups.com.
To post to this group, send email to media...@googlegroups.com.
Visit this group at http://groups.google.com/group/mediathread.
For more options, visit https://groups.google.com/groups/opt_out.

john wallace

unread,
Feb 12, 2014, 3:28:38 PM2/12/14
to media...@googlegroups.com
Hi Susan,

Thanks for looking at this.

/var/www/mediathread/mediathread/settings_produciton.py exists ;   the error suggests maybe "sys.path" is not set correctly;  do you know where sys.path gets set?

Regards,

-John
You received this message because you are subscribed to a topic in the Google Groups "Mediathread" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mediathread/DTzrgr3D9gw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mediathread...@googlegroups.com.

Susan Dreher

unread,
Feb 12, 2014, 3:30:43 PM2/12/14
to media...@googlegroups.com
Hi John - 

sys.path is set in your wsgi file. Take a look at the current configuration and see if it is correct for your environment. You may need to modify the settings there.

Cheers,
Susan 

John wallace

unread,
Feb 12, 2014, 3:41:44 PM2/12/14
to media...@googlegroups.com
HI,

I'm wondering if it's using the correct wsgi file since ....

./apache/django.wsgi  

             has 


# paths we might need to pick up the project's settings
sys.path.append('/var/www/mediathread/mediathread/')

                  and 

/var/www/mediathread/mediathread/

                  has the settings files

-rw-r--r--  1 methuser methuser 10078 Jan 30 16:12 api.py
-rw-r--r--  1 methuser methuser 11082 Feb  5 14:36 api.pyc
drwxr-xr-x  7 methuser methuser  4096 Feb 11 15:16 assetmgr
drwxr-xr-x  2 methuser methuser  4096 Feb 11 15:16 discussions
drwxr-xr-x  4 methuser methuser  4096 Feb 11 15:16 djangosherd
-rw-r--r--  1 methuser methuser     0 Jan 30 16:12 __init__.py
-rw-r--r--  1 methuser methuser   131 Feb  5 14:34 __init__.pyc
drwxr-xr-x  7 methuser methuser  4096 Feb 11 15:16 main
drwxr-xr-x  7 methuser methuser  4096 Feb 11 15:16 projects
drwxr-xr-x  2 methuser methuser  4096 Feb 11 15:16 reports
-rw-r--r--  1 methuser methuser  1391 Jan 30 16:12 settings_dev.py
-rw-r--r--  1 methuser methuser  1319 Jan 30 16:12 settings_production.py
-rw-r--r--  1 methuser methuser   113 Jan 30 16:12 settings.py
-rw-r--r--  1 methuser methuser   254 Feb  5 14:34 settings.pyc
-rw-r--r--  1 methuser methuser  7932 Feb  4 16:13 settings_shared.py
-rw-r--r--  1 methuser methuser  7550 Feb  5 14:34 settings_shared.pyc
-rw-r--r--  1 methuser methuser  7932 Feb  4 16:10 settings_shared.py.orig
-rw-r--r--  1 methuser methuser  1355 Jan 30 16:12 settings_staging.py
-rw-r--r--  1 methuser methuser  1792 Jan 30 16:12 settings_test.py
drwxr-xr-x  4 methuser methuser  4096 Feb 11 15:16 taxonomy
drwxr-xr-x 15 methuser methuser  4096 Jan 30 16:12 templates
-rw-r--r--  1 methuser methuser  4801 Jan 30 16:12 urls.py
-rw-r--r--  1 methuser methuser  4566 Feb  5 14:36 urls.pyc


-John




Susan Dreher

unread,
Feb 12, 2014, 3:45:41 PM2/12/14
to media...@googlegroups.com
Sure - that could be the problem. 

Verify your your apache.conf is correctly pointing to the right wsgi file. 

The line should look like this:  WSGIScriptAlias / /var/www/mediathread/mediathread/apache/django.wsgi

s.

john wallace

unread,
Feb 12, 2014, 5:59:02 PM2/12/14
to media...@googlegroups.com


WSGIScriptAlias  appears to be fine but my base path is  /var/www/mediathread and not  /var/www/mediathread/mediathread --- if had to track down some other fixed paths to change /mediathread/mediathread/  to /mediathread/ , so I'm thinking I should just go back and redo the install to keep things simple.


-John
Reply all
Reply to author
Forward
0 new messages