I'm trying to work through the django tutorial but have gotten hung up on displaying the css associated with the admin module. I'm working on windows, with django 1.6, apache and MySQL
My current hierarchy is as follows:
MySite
|
|---static
| |--admin
| |--css
| |--img
| |--js
|---MyApp
| |--__init__.py
| |--admin.py
| |--models.py
| |--tests.py
| |--views.py
|---MySite
| |--__init.py
| |--settings.py
| |--testdb.py
| |--urls.py
| |--wsgi.py
|--manage.py
within the settings.py file I've defined the STATIC_URL as
STATIC_URL = '/MySite/static/'
When I inspect the resulting admin page it shows that it is looking for the css at MySite/static/admin/css, which is where it is, but its not finding it there. It seems the root isn't correct.
In my urls.py I've got
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
EDIT:
My Apache htttpd.conf file is completely untouched from what XAMPP originally installed, except I've included *LoadModule wsgi_module modules/mod_wsgi.so* at the appropriate spot, and appended
WSGIScriptAlias /MySite F:/Web_Django/MySite/MySite/wsgi.py
WSGIPythonPath F:/Web_Django/MySite
<Directory F:/Web_Django/MySite/MySite/>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
I've included the entire file at http://pastebin.com/AD77f69c
EDIT2:
I've discovered that when using apache you need to implement the wsgi.py file slightly differently. I now have the following, but the problem remains.
import os
import sys
path = 'f:/web_django/Nutana/'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'Nutana.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Graham Dumpleton, the developer of the modwsgi adaptor for apache, provides an alternate wsgi file which he (and many others, apparently) feels works better in an old blog post (http://tinyurl.com/y8wr7gc), but it doesn't work for me.