Howdy all,
I decided to update from 1.6 to 2.0 and have encountered the following
odd error below when attempting to access the new Django web interface
at cobbler_web. I've looked back through the mailing list but have not
quite figured out what the deal is. (The error I'm getting is posted in
full at the end.)
I've updated /etc/cobbler/settings.rpmnew to /etc/cobbler/settings
and /etc/cobbler/modules.conf.rpmnew to /etc/cobbler/modules
The file /usr/share/cobbler/web/settings.py exists and is has
permissions of the web server, etc.
Restarting httpd and cobbler look fine:
[root@cobbler conf.d]# /etc/init.d/cobblerd restart
Stopping cobbler daemon: [ OK ]
Starting cobbler daemon: SERVING!
[ OK ]
The Apache config file for the web ui looks okay:
[root@cobbler]# cat /etc/httpd/conf.d/cobbler_web.conf
# This configuration file enables the cobbler web
# interface (django version)
<VirtualHost *:80>
# Do not log the requests generated from the event notification system
SetEnvIf Request_URI ".*/op/events/user/.*" dontlog
# Log only what remains
CustomLog logs/access_log combined env=!dontlog
<Location "/cobbler_web">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
# PythonOption django.root /cobbler_web
PythonDebug On
PythonPath "['/usr/share/cobbler/web/'] + sys.path"
AuthBasicAuthoritative Off
AuthType basic
AuthName "Cobbler"
Require valid-user
PythonAuthenHandler cobbler_web.views
</Location>
</VirtualHost>
Any hints?
Thanks,
Pete Eby
* * *
Mod_python error: "PythonAuthenHandler cobbler_web.views"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
287, in HandlerDispatch
log=debug)
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
464, in import_module
module = imp.load_module(mname, f, p, d)
File "/usr/share/cobbler/web/cobbler_web/views.py", line 1, in ?
from django.template.loader import get_template
File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 918, in ?
add_to_builtins('django.template.defaultfilters')
File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 915, in add_to_builtins
builtins.append(get_library(module_name))
File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 904, in get_library
mod = __import__(module_name, {}, {}, [''])
File
"/usr/lib/python2.4/site-packages/django/template/defaultfilters.py",
line 5, in ?
from django.utils.translation import gettext
File
"/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py",
line 3, in ?
if settings.USE_I18N:
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
28, in __getattr__
self._import_settings()
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
55, in _import_settings
self._target = Settings(settings_module)
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
83, in __init__
raise EnvironmentError, "Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings
'/usr/share/cobbler/web/settings.py' (Is it on sys.path? Does it have
syntax errors?): No module named /usr/share/cobbler/web/settings.py
Show replies by date
Hi all,
Hummm . . . Now I'm just getting this, but I can't seem how to export
DJANGO_SETTINGS_MODULE to make it happy.
Thanks,
Pete Eby
od_python error: "PythonAuthenHandler cobbler_web.views"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
287, in HandlerDispatch
log=debug)
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
464, in import_module
module = imp.load_module(mname, f, p, d)
File "/usr/share/cobbler/web/cobbler_web/views.py", line 1, in ?
from django.template.loader import get_template
File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 918, in ?
add_to_builtins('django.template.defaultfilters')
File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 915, in add_to_builtins
builtins.append(get_library(module_name))
File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 904, in get_library
mod = __import__(module_name, {}, {}, [''])
File
"/usr/lib/python2.4/site-packages/django/template/defaultfilters.py",
line 5, in ?
from django.utils.translation import gettext
File
"/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py",
line 3, in ?
if settings.USE_I18N:
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
28, in __getattr__
self._import_settings()
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
53, in _import_settings
raise EnvironmentError, "Environment variable %s is undefined." %
ENVIRONMENT_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.
Not be be annoying, but I thought I would add that trying to just export
the module manually seems to have the same result - I am sure I'm likely
missing something obvious here . . .
Thanks,
Pete
[root@cobbler usr]# export DJANGO_SETTINGS_MODULE=settings.py
[root@cobbler usr]#
usr/lib/python2.4/site-packages/django/bin/django-admin.py runserver
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/bin/django-admin.py",
line 5, in ?
management.execute_from_command_line()
File "/usr/lib/python2.4/site-packages/django/core/management.py",
line 1563, in execute_from_command_line
from django.utils import translation
File
"/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py",
line 3, in ?
if settings.USE_I18N:
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
28, in __getattr__
self._import_settings()
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
55, in _import_settings
self._target = Settings(settings_module)
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
83, in __init__
raise EnvironmentError, "Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings 'settings.py' (Is it on
sys.path? Does it have syntax errors?): No module named settings.py
Howdy,
I resolved the first issues with export DJANGO_SETTINGS_MODULE=settings
(I think it had an extra .py on the module name). I was then able to
reload Django with django-admin.py runserver.
I found then that the old Cobbler Log used to be owned by root, so I
changed that to the web server.
However, now when the Django web page comes up I am getting:
AttributeError at /cobbler_web/
'module' object has no attribute 'autodiscover'
Request Method: GET
Request URL:
http://cobbler.sagonet.com/cobbler_web/
Exception Type: AttributeError
Exception Value: 'module' object has no attribute 'autodiscover'
Exception Location:
/usr/lib/python2.4/site-packages/django/core/urlresolvers.py in
_get_urlconf_module, line 177
Any ideas would be much appreciated.
Thanks,
Pete Eby