On Sun, Oct 31, 2010 at 6:14 PM, elliot <offonoffoffon...@gmail.com> wrote: > 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?)
Hi Elliot, Actually 'Django' doesn't need to find these at all, it's Apache that is having the issue. First off you probably want to be using mod_wsgi and not mod_python as that mod_python project is no longer actively maintained. What you need to do is add a <Directory> directive for your media locations such that Apache can find these files, or more correctly that Apache believes it is authorized to serve those files. Watch your Apache error log and you'll see tons of 404s for your media files. -- Frank Wiles Revolution Systems | http://www.revsys.com/ fr...@revsys.com | (800) 647-6298 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.