Thanks Tom, your post got me thinking ! If the problem was the pathing then
using the absolute path should have worked. So , I put in
STATIC_ROOT="/home/vibhu/Programming/qj/static/"

But that still did not work - which means that I was still doing something
wrong. Finally, it hit me - I was using the wrong variable (see comment
copied below).

Instead of STATIC_ROOT , I should have been using STATICFILES_DIR

So, now my settings.py is as follows :

# Absolute path to the directory static files should be collected to.
# *Don't put anything in this directory yourself*; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
STATIC_ROOT=""
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
 os.path.join(os.path.dirname(__file__),'../static/'),
)


And this is working ! Thanks for the tip for going up a directory else i
would still be floundering !

Vibhu



On Thu, Apr 4, 2013 at 7:24 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Thu, Apr 4, 2013 at 8:49 AM, Vibhu Rishi <vibhu.ri...@gmail.com> wrote:
> > I am not sure where I am going wrong, but the CSS files are just not
> getting
> > picked up. I have just started a project and am using the dev server with
> > the runserver command.
> >
> > Here's my relevant settings.py :
> >
> >
> > STATIC_ROOT = os.path.join(os.path.dirname(__file__),'/static/')
> > STATIC_URL = '/static/'
> >
> > My directory structure :
> > .
> > ├── homepage
> > │   └── templates
> > │       └── homepage
> > ├── qj
> > └── static
> >     ├── css
> >     ├── img
> >     └── js
> >
> > qj is where my settings.py file is.
> > static is where i have the css.
>
> You've told it to look in the wrong place:
>
> >>> os.path.dirname('/path/to/project/qj/settings.py')
> '/path/to/project/qj'
> >>> os.path.join(os.path.dirname('/path/to/project/qj/settings.py'),
> 'static')
> '/path/to/project/qj/static'
>
> Try this instead:
>
> STATIC_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__),
> '..', '/static/'))
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

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


Reply via email to