On Sat, Mar 2, 2013 at 4:47 PM, Phil <phil...@gmail.com> wrote:
> Hi,
>
> I'm using django1.4.3
>
> I have a django project with 3 apps. All 3 apps templates extend 'app.html'.
> On 2 of my projects the CSS loads fine, but on third one the CSS doesn't get
> loaded because it's not adding '/static/' to the url to the CSS. So instead
> of '/static/css/style.css' I'm getting '/css/style.css' ...
>
> <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/style.css">

Technically speaking, if that is your template, and you end up with
"/css/style.css", then STATIC_URL is not empty, it is '/'.

>
> STATIC_URL is working on the 2 projects that use generic views, but not on
> the other one. So how can 'STATIC_URL' be blank and how can this be fixed? I
> tried adding the following to my index.html template but no joy...
>
> {% load static %}
> {% get_static_prefix as STATIC_PREFIX %}
>

To clarify - you only have one project, with three apps in it. In two
of the apps, which only use generic views, STATIC_URL works correctly,
but in third app it does not.

Do these views in the third app use RequestContext to render the
templates? Generic views do…

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.


Reply via email to