Hi
I have set up a basic project and am trying to get it running under
Apache in a shared virtual hosting environment. The aim is to get it
working here first, and then work with my hosting company so that they
can support Django for their customers.

The problem is that I cannot configure it so that the admin CSS files
are located properly. The admin application is working fine, just no
style sheets. I keep getting

www.mytestapp.com:80 127.0.0.1 - - [01/May/2010:09:37:38 +0100] "GET /
admin/ HTTP/1.1" 200 1286 "http://www.mytestapp.com/admin/logout/";
"Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.9) Gecko/20100402
Ubuntu/9.10 (karmic) Firefox/3.5.9"
www.mytestapp.com:80 127.0.0.1 - - [01/May/2010:09:37:38 +0100] "GET /
admin_media/css/base.css HTTP/1.1" 404 1239 "http://www.mytestapp.com/
admin/" "Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.9) Gecko/
20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9"
www.mytestapp.com:80 127.0.0.1 - - [01/May/2010:09:37:38 +0100] "GET /
admin_media/css/login.css HTTP/1.1" 404 1240 "http://www.mytestapp.com/
admin/" "Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.9) Gecko/
20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9"

I have been trying to get this working for days, and have followed
advice offered in several posts on this site to no avail. I am sure
that I am either not understanding something fundamental, or are
missing some simple trick or something basic.
I have put all relevant information here. Any help would be
appreciated.

David


My Project lives in TestProject. Its called mytestapp and was built
using
django-admin startproject mytestapp

I have added a directory within mytestapp called /www where there is
1. a link called admin_media to the admin applicaion media files
2. a further directory with the django,wsgi script

Here is the directory structure and files

maxw...@shiraz:~/TestProject$ ls -alR
drwxr-xr-x  3 maxweld maxweld 4096 2010-04-27 19:09 .
drwxr-xr-x 58 maxweld maxweld 4096 2010-05-01 09:37 ..
drwxr-xr-x  3 maxweld maxweld 4096 2010-05-01 08:59 mytestapp

./mytestapp:
-rw-r--r-- 1 maxweld maxweld    0 2010-04-27 19:09 __init__.py
-rwxr-xr-x 1 maxweld maxweld  542 2010-04-27 19:09 manage.py
-rw-r--r-- 1 maxweld maxweld 2851 2010-04-29 18:16 settings.py
-rw-r--r-- 1 maxweld maxweld  542 2010-04-27 19:33 urls.py
drwxr-xr-x 3 maxweld maxweld 4096 2010-05-01 09:21 www

./mytestapp/www:
lrwxrwxrwx 1 maxweld maxweld   46 2010-05-01 09:06 admin_media -> /usr/
share/pyshared/django/contrib/admin/media
drwxr-xr-x 2 maxweld maxweld 4096 2010-04-27 20:03 wsgi

./mytestapp/www/wsgi:
-rw-r--r-- 1 maxweld maxweld  268 2010-04-27 20:03 django.wsgi


The virtual host is configured thus:
<VirtualHost *:80>

        ServerName www.mytestapp.com
        ServerAlias mytestapp.com

        DocumentRoot /home/maxweld/TestProject/mytestapp/www

        WSGIScriptAlias / /home/maxweld/TestProject/mytestapp/www/wsgi/
django.wsgi

        <Directory /home/maxweld/TestProject/mytestapp/www/wsgi>
        Order deny,allow
        Allow from all
        </Directory>

</VirtualHost>

urls.py is configured thus:
maxw...@shiraz:~/TestProject/mytestapp$ cat urls.py
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^mytestapp/', include('mytestapp.foo.urls')),

    # Uncomment the admin/doc line below and add
'django.contrib.admindocs'
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)

And settings.py is configured thus:
# Django settings for mytestapp project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_em...@domain.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'mysql'           # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'myprojectdb'             # Or path to database file
if using sqlite3.
DATABASE_USER = 'myprojectuser'             # Not used with sqlite3.
DATABASE_PASSWORD = '########'         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'Europe/London'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-gb'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = False

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/admin_media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '-0=2(&s...@9aht8(3!%+qpd)1kk...@k6@^)thu5%tw$...@2'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

ROOT_URLCONF = 'mytestapp.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
)

-- 
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.

Reply via email to