Sunday, October 31, 2010

Apache config. admin page displays without stylesheets

Django runs as expected using manage.py runserver, but when I run it
from apache certain files are not found.

This is because the apache user has a different base directory than
the user running manage.py. So, I added absolute paths to my
setting.py and other files. Now through apache one can access all the
modules and pages just fine. But when I try to go to /admin I see
there is no css formatting. everything is very plain and not like the
version through runserver at all.

I assume this is because the css file is not being found. But if the
admin code is found, and allows me the properly add items and
everything, why isn't the css found?

granted, the html code I've written doesn't have any css going on, so
I cant say that only the admin pages aren't rendering right.

my apache setup looks like:
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/libadmin/library/django-ils/','/home/
libadmin/library/django-ils/bookshare'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE bookshare.settings
PythonOption django.root /home/libadmin/library/django-ils/bookshare/
PythonDebug On
</Location>

Thinking that a relative path to the css file was being misused I
checked the source of the admin login page in firefox. The admin site
is looking for <link rel="stylesheet" type="text/css" href="/media/css/
login.css" />

this file exsists in both
/usr/share/python-support/python-django/django/contrib/admin/media/css/
login.css
/var/lib/python-support/python2.5/django/contrib/admin/media/css/
login.css

so, is django not finding this file because of an irrendered relative
path? and if so, what is wrong with my configuration that this isn't
found?

(This is being run from a cloned mercurial repo, so I did not start
this project on this machine with the django scripts. if this is the
issue, is there a way to manually do what the startproject or startapp
scripts are supposed to do?)

thanks,
Elliot

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment