Yes make sure your STATICFILES_DIRS setting is pointing to the exact 
location you want to put them in, and then make sure all of the needed 
files are indeed being collected by manage.py collectstatic.

after that, assuming your static_url is set to /static/, you should have no 
problems referencing them, just make sure that you include the directory 
name in the url as well(e.g. localhost:8000/static/styles/style.css). 

I usually setup my staticfiles_dirs to go into project/project/staticdump, 
just make sure you're letting django do all of the collection and you 
aren't placing files in STATIC_ROOT yourself.


On Wednesday, December 26, 2012 11:15:26 PM UTC-6, Mike Dewhirst wrote:
>
> On 27/12/2012 2:03pm, wars...@gmail.com <javascript:> wrote: 
> > I am having an unbelievable time getting my new django application to 
> > servie static files, i have read the django documentation but it seems 
> > as there isn't one consistent way to serve static files while in 
> > development using the Django server. 
> > 
> > In order are my settings.py file, my urls.py file and finally in my 
> > base.html where i reference these files. 
> > 
> > 
> > I have no idea why i still get 404 not found errors when the path is 
> > full load as in when i reference in my base.html file {{ Media_Url}} it 
> > actually resolves to /media/ yet the file is still not found. 
> > 
> > If anyone can help, please let me know. i have spent way to long on this 
> > small issue. 
>
> I remember I found it tricky in the beginning. The way I finally got my 
> head around it was to put print statements in my settings file (if DEBUG 
> of course) to output the paths for static and media dirs. Then I 
> experimented with settings.STATICFILES_FINDERS until I figured out 
> exactly what delivered the goods. 
>
> hth 
>
> Mike 
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/django-users/-/r63T5ycQ81MJ. 
> > To post to this group, send email to 
> > django...@googlegroups.com<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com <javascript:>. 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DxKA3NjpkzUJ.
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