Re: Passing variables to css file in django
Oh! I am sorry. What I meant was, how do I let users customize their page if they wanted to? I suppose I could have done this without using external stylesheet, but yes, CSS is served fastest if it's static. I hope, I made myself clear. Please guide me if there's a way to achive this
On Mon, Aug 26, 2013 at 5:39 AM, Andy McKay <andy@clearwind.ca> wrote:
--Any string can be rendered as a template. This is covered pretty well in the docs:For example:
https://docs.djangoproject.com/en/dev/ref/templates/api/
>>> from django.template import Context, Template
>>> t = Template("body { background-color: {{ bgcolor }} }")>>> c = Context({'bgcolor': '#999'})
>>> t.render(context=c)
u'body { background-color: #999 }'However, CSS is served fastest if it's static and on a CDN and not using a template and CPU resources to render.
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.
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