Re: Trouble with STATIC_URL in v1.5.2
Check that your STATIC_URL setting in your template is outputting the same string as settings.STATIC_URL. Make sure that any included local_settings.py files are not wiping out those settings. You can check it using the Django shell:
K
On Monday, September 16, 2013 12:43:04 PM UTC-7, Adam wrote:
-- $ python manage.py shell
>>> from django.conf import settings
>>> settings.STATIC_URL
'/assets/static/'
If not, check that you're using RequestContext to render your views. You can do this from the Django shell as well.
>>> from django.http import HttpRequest
>>> r = HttpRequest()
>>> from django.template import Template
>>> t = Template("{{ STATIC_URL }}")
>>> from django.template import RequestContext
>>> c = RequestContext(r, {})
>>> t.render(c)
u'/assets/static/'
Check that you're including 'django.core.context_processors.static' in your settings.TEMPLATE_CONTEXT_PROCESSORS tuple.
>>> settings.TEMPLATE_CONTEXT_PROCESSORS
('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.contrib.messages.context_processors.messages')
K
On Monday, September 16, 2013 12:43:04 PM UTC-7, Adam wrote:
Maybe this is something well known.
I'm using STATIC_URL in my templates. Worked perfectly in Django 1.4.x.
Upgraded to v1.5.2. Now STATIC_URL ONLY works when the DEBUG setting is
True. When set to False (For production), STATIC_URL is an empty string
in the template.
Anybody have any idea why this might be happening or what to look at?
Everything that needs to be set for STATIC_URL is set, otherwise it
wouldn't have worked in v1.4.x in the first place.
--
Adam (ad...@csh.rit.edu)
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+unsubscribe@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.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home