Friday, June 28, 2013

Re: Static files not served

Is DEBUG is set to True or False?
And can you open static files by paths that are present in page source? I.e.
by path which generated from (for exampe) {% static "js/jquery.min.js" %}?
> Hi @der_fenix,
>
> My STATIC_URL setting is as follows: STATIC_URL = '/static/'
>
> I suspect that Django's development server's static serving does not like
> noscript tags? I have no idea. I might poke around later ... starting from
> Django's 'django.contrib.staticfiles.views.serve()' call.
>
> On Thu, Jun 27, 2013 at 10:47 PM, der_fenix <derfenix@gmail.com> wrote:
> > Is there you main static dir in STATIC_URL in settings.py?
> >
> > > Update: removing the noscript tags around the css tags in the template
> > > solves the issue. I am no clientside scripting expert, but it is my
> > > understanding that noscript tags accommodate browsers with scripting
> >
> > turned
> >
> > > off, or legacy browsers? Surely the css should work by default?
> > >
> > > I know this is not an html mailing list, but has anybody else
> > > encountered
> > > this?
> > >
> > > Another thing i noticed is that all this is not a problem when i view
> > > the
> > > templates from outside a Django project - i.e. as a standalone html
> >
> > website.
> >
> > > On Thu, Jun 27, 2013 at 10:08 PM, Sithembewena Lloyd Dube <
> >
> > zebra05@gmail.com
> >
> > > > wrote:
> > > >
> > > > Hi all,
> > > >
> > > > I have a local development project where I put all static media in a
> > > > 'static' subdirectory of my app (/project/app/static/). I then created
> >
> > a
> >
> > > > 'static' directory in the root folder of my project (/project/static/)
> >
> > and
> >
> > > > specified that as my STATIC_ROOT in settings.py.
> > > >
> > > > When I run the './manage.py collectstatic' command, all static media
> >
> > are
> >
> > > > added to the static root as expected. In the templates, usage is as
> > > > follows: '<script src="{% static "js/jquery.min.js" %}"></script>' and
> >
> > so
> >
> > > > on, but when I view the page in a browser the CSS and js are not
> >
> > applied.
> >
> > > > If I view page source and click on the generated links to static
> > > > resources,
> > > > I do see them.
> > > >
> > > > One thing I do notice is that two of the missing css files are in the
> > > > document's noscript tag and the links for all three are not clickable
> >
> > when
> >
> > > > viewing source. There are three in there, so one loads fine.
> > > >
> > > > Any pointers to what I could be missing? Thanks.
> > > > --
> > > > Regards,
> > > > Sithu Lloyd Dube

No comments:

Post a Comment