well at my side it works well on both *nix and windoof platforms... here is
what I use on my projects...

settings.py
--------------
import platform
import os

PROJECT_DIR = os.path.dirname( os.path.abspath(__file__))
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'static')
-----------

urls.py
-----------------
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings

urlpatterns = patterns('',
    #urls for your project
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': settings.MEDIA_ROOT}),
)
------------
where i use a directory named 'static' residing in same folder, where i have
my settings.py  .... can you please place 'print MEDIA_ROOT' inside your
settings.py and check the terminal the path is spilts out ? because your '-'
convention before '-\media' is sort confusing, and its missing before
manage.py and settings.py ---- is media folder residing really in the same
directory where settings.py ?

c:\dev
>   -\proj
>      __init__.py
>      manage.py
>      settings.py
>      urls.py
>      -\app
>      -__init__.py
>      -admin.py
>      -models.py
>      -views.py
>      -\adminmedia
>      -\media
>        -\css
>          -styles.css
>        -\images
>      -\templates
>        -base.html
>        -index.html
>

if 'print MEDIA_ROOT' spilts out a path different from your media folder,
then you know where is the problem ..

Greetings,
Puneet

On Thu, Jan 22, 2009 at 5:40 PM, john <johnwalla...@gmail.com> wrote:

>
> Thanks but no change.
>
> On Jan 22, 11:30 am, Puneet Madaan <puneetmad...@gmail.com> wrote:
> > beside <link rel="stylesheet" type="text/css"
> href="{MEDIA_URL}css/styles.css">
> > you need to correct settings.py to
> >
> > SETTINGS_FILE_FOLDER = os.path.dirname( os.path.abspath(__file__))
> >
> >
> >
> > On Thu, Jan 22, 2009 at 5:26 PM, john <johnwalla...@gmail.com> wrote:
> >
> > > Thanks but no change.
> >
> > > On Jan 22, 11:02 am, Dj Gilcrease <digitalx...@gmail.com> wrote:
> > > > change
> > > > <link rel="stylesheet" type="text/css" href="/css/styles.css">
> > > > to
> > > > <link rel="stylesheet" type="text/css"
> href="{MEDIA_URL}css/styles.css">
> >
> > > > Dj Gilcrease
> > > > OpenRPG Developer
> > > > ~~http://www.openrpg.com
> >
> > > > On Thu, Jan 22, 2009 at 8:53 AM, john <johnwalla...@gmail.com>
> wrote:
> >
> > > > > No matter what i do i can't get my css to load. 100% Frustrated
> with
> > > > > Django. My index page loads when i requesthttp://
> 127.0.0.1:8000/but
> > > > > it is not styled. Django dev server returns 404 in console for "GET
> /
> > > > > css/styles.css HTTP/1.1"
> >
> > > > > In my base template i have:
> > > > > <link rel="stylesheet" type="text/css" href="/css/styles.css">
> >
> > > > > In my urls.py I have:
> > > > > urlpatterns = patterns('',
> > > > >     (r'^$', 'proj.app.views.index'),
> > > > >     (r'^admin/(.*)', admin.site.root),
> > > > >     (r'^media/(?P<path>.*)$', 'django.views.static.serve',
> > > > > {'document_root': settings.MEDIA_ROOT}),
> > > > > )
> >
> > > > > In my settings.py i have (among other things):
> > > > > import os
> > > > > SETTINGS_FILE_FOLDER = os.path.dirname(__file__)
> > > > > MEDIA_ROOT = os.path.join(SETTINGS_FILE_FOLDER, 'media')
> > > > > MEDIA_URL = 'http://127.0.0.1:8000/media/'
> > > > > ADMIN_MEDIA_PREFIX =  'adminmedia'
> >
> > > > > my directory structure in windows is:
> >
> > > > > c:\dev
> > > > >   -\proj
> > > > >      __init__.py
> > > > >      manage.py
> > > > >      settings.py
> > > > >      urls.py
> > > > >      -\app
> > > > >      -__init__.py
> > > > >      -admin.py
> > > > >      -models.py
> > > > >      -views.py
> > > > >      -\adminmedia
> > > > >      -\media
> > > > >        -\css
> > > > >          -styles.css
> > > > >        -\images
> > > > >      -\templates
> > > > >        -base.html
> > > > >        -index.html
> >
> > --
> > If you spin an oriental man, does he become disoriented?
> > (-: ¿ʇɥǝɹpɹǝʌ ɟdoʞ uǝp ɹıp ɥɔı ,qɐɥ 'ɐɐu
> >
> > is der net süß » ε(●̮̮̃•̃)з
> > -----PM
> >
>


-- 
If you spin an oriental man, does he become disoriented?
(-: ¿ʇɥǝɹpɹǝʌ ɟdoʞ uǝp ɹıp ɥɔı ,qɐɥ 'ɐɐu

is der net süß » ε(●̮̮̃•̃)з
-----PM

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to