WebFaction
Community site: login faq

I uploaded a copy of my django app to the newly created app folder called dev.The dev app is attached to my website. This is an exception that I am getting when I try to open up my website in the browser. I got this exception from error_ninja.log

[Sun Jun 05 21:18:30.874868 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24] mod_wsgi (pid=1828): Target WSGI script '/home/username/webapps/ninja/myproject/myproject/wsgi.py' cannot be loaded as Python module.
[Sun Jun 05 21:18:30.874897 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24] mod_wsgi (pid=1828): Exception occurred processing WSGI script '/home/username/webapps/ninja/myproject/myproject/wsgi.py'.
[Sun Jun 05 21:18:30.875000 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24] Traceback (most recent call last):
[Sun Jun 05 21:18:30.875030 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/home/username/webapps/ninja/myproject/myproject/wsgi.py", line 8, in <module>
[Sun Jun 05 21:18:30.875037 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     application = get_wsgi_application()
[Sun Jun 05 21:18:30.875042 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/home/username/webapps/ninja/lib/python3.5/Django-1.9.6-py3.5.egg/django/core/wsgi.py", line 13, in get_wsgi_application
[Sun Jun 05 21:18:30.875044 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     django.setup()
[Sun Jun 05 21:18:30.875047 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/home/username/webapps/ninja/lib/python3.5/Django-1.9.6-py3.5.egg/django/__init__.py", line 17, in setup
[Sun Jun 05 21:18:30.875049 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Sun Jun 05 21:18:30.875053 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/home/username/webapps/ninja/lib/python3.5/Django-1.9.6-py3.5.egg/django/conf/__init__.py", line 55, in __getattr__
[Sun Jun 05 21:18:30.875055 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     self._setup(name)
[Sun Jun 05 21:18:30.875058 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/home/username/webapps/ninja/lib/python3.5/Django-1.9.6-py3.5.egg/django/conf/__init__.py", line 43, in _setup
[Sun Jun 05 21:18:30.875060 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     self._wrapped = Settings(settings_module)
[Sun Jun 05 21:18:30.875064 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/home/username/webapps/ninja/lib/python3.5/Django-1.9.6-py3.5.egg/django/conf/__init__.py", line 99, in __init__
[Sun Jun 05 21:18:30.875066 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Sun Jun 05 21:18:30.875069 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
[Sun Jun 05 21:18:30.875071 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]     return _bootstrap._gcd_import(name[level:], package, level)
[Sun Jun 05 21:18:30.875074 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Sun Jun 05 21:18:30.875078 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Sun Jun 05 21:18:30.875081 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24]   File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
[Sun Jun 05 21:18:30.875093 2016] [wsgi:error] [pid 1828:tid 139999390471936] [remote 127.0.0.1:24] ImportError: No module named 'wrotation.settings'

any suggestions on where I might be going wrong ?

asked 05 Jun '16, 21:38

franco850
910
accept rate: 0%


The file path which contains the python module 'wrotation' (which should than contain your settings.py file/module) needs to be defined within ./apache2/conf/httpd.conf on the python-path parameter of the WSGIDaemonProcess config line.

WSGIDaemonProcess foo processes=2 threads=12 python-path=/home/you/webapps/app/foo:/home/you/webapps/app/foo/bar

Where '/home/you/webapps/app/foo' or '/home/you/webapps/app/foo/bar' or whatever path you have there contains a directory named 'wrotation'

ls /home/you/webapps/app/foo | grep wtotation
ls /home/you/webapps/app/foo/bar | grep wtotation

One of those commands should show the directory/module.

permanent link

answered 05 Jun '16, 23:19

johns
5.3k312
accept rate: 23%

edited 05 Jun '16, 23:24

Thanks a lot for clearing that up

(06 Jun '16, 16:29) franco850
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×62
×3
×3

question asked: 05 Jun '16, 21:38

question was seen: 2,156 times

last updated: 06 Jun '16, 16:29

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM