Hello. I have installed NAV on Ubuntu 14.04 using this manual: https://nav.uninett.no/wiki/nav_on_debian But when I try to connect to server with my browser, I receive "500 Internal Server Error". This is what I see in apache's error.log:
[Thu Jul 31 20:59:00.541666 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] mod_wsgi (pid=938): Exception occurred processing WSGI script '/usr/share/pyshared/nav/wsgi.py'. [Thu Jul 31 20:59:00.541733 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] Traceback (most recent call last): [Thu Jul 31 20:59:00.541775 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 206, in __call__ [Thu Jul 31 20:59:00.541851 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] response = self.get_response(request) [Thu Jul 31 20:59:00.541889 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in get_response [Thu Jul 31 20:59:00.541934 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] resolver, sys.exc_info()) [Thu Jul 31 20:59:00.541980 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 232, in handle_uncaught_exception [Thu Jul 31 20:59:00.542044 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] if resolver.urlconf_module is None: [Thu Jul 31 20:59:00.542079 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 360, in urlconf_module [Thu Jul 31 20:59:00.542138 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] self._urlconf_module = import_module(self.urlconf_name) [Thu Jul 31 20:59:00.542173 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module [Thu Jul 31 20:59:00.542216 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] __import__(name) [Thu Jul 31 20:59:00.542249 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/nav/django/urls.py", line 22, in <module> [Thu Jul 31 20:59:00.542313 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] from django.conf.urls.defaults import patterns, include, url [Thu Jul 31 20:59:00.542357 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] ImportError: No module named defaults
What is wrong with my installation?
On Thu, 31 Jul 2014 23:07:36 +0400 Alexander Zubkov green@msu.ru wrote:
Hello. I have installed NAV on Ubuntu 14.04 using this manual: https://nav.uninett.no/wiki/nav_on_debian But when I try to connect to server with my browser, I receive "500 Internal Server Error". This is what I see in apache's error.log:
[snip]
[remote 192.168.0.0:8082] File "/usr/lib/python2.7/dist-packages/nav/django/urls.py", line 22, in <module> [Thu Jul 31 20:59:00.542313 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] from django.conf.urls.defaults import patterns, include, url [Thu Jul 31 20:59:00.542357 2014] [:error] [pid 938:tid 127863399364352] [remote 192.168.0.0:8082] ImportError: No module named defaults
What is wrong with my installation?
Hi there,
Ubuntu 14.04 provides Django 1.6; NAV has not been tested on anything newer than Django 1.4. This errors appears to be due to one of many changes between Django 1.4 and 1.6.
The nav Debian package itself is probably wrong to assert the dependency to 'python-django >= 1.4'.
You seem to have three options:
1. Downgrade to Django 1.4 by finding or building a package compatible with Ubuntu 14.04.
2. Forcibly uninstall Django 1.4 and use "pip install 'django>=1.4,<1.5'" to install a compatible version outside of the APT system.
3. Hack /usr/lib/python2.7/dist-packages/nav/django/urls.py by replacing
from django.conf.urls.defaults import patterns, include, url
with
from django.conf.urls import patterns, include, url
and then pray everything will otherwise work fine on Django 1.6. There is a high chance, however, that there will be further errors.
We are generally tracking Debian stable for development dependencies, with a few exceptions, which we are packaging ourselves. Debian are planning to freeze their next stable release around the 5th of November, which means we may start looking at making NAV work with whatever version of Django they freeze on around that time.