Dynamic CSS

48 views
Skip to first unread message

Drew Ferguson

unread,
Aug 12, 2014, 7:36:11 PM8/12/14
to django...@googlegroups.com
Hi

Is there any documentation describing possible ways of having dynamic CSS
in a site?

For example, having a CSS colour scheme set from a database query or
setting a site logo URL from a database query

Ta
--
Drew Ferguson

François Schiettecatte

unread,
Aug 12, 2014, 7:54:24 PM8/12/14
to django...@googlegroups.com
You could certainly render the CSS either in-line in the HMTL pages or in templates, just produce CSS as opposed to HTML (I have produced RSS, ATOM, XML and JSON in templates). Or you could have multiple CSS files and just pick the one you want to use when you render the link to the CSS in your HTML pages.

François
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20140813003710.3f766b96%40blacktav.fergiesontour.org.
> For more options, visit https://groups.google.com/d/optout.

Drew Ferguson

unread,
Aug 12, 2014, 8:36:04 PM8/12/14
to django...@googlegroups.com
On Tue, 12 Aug 2014 19:53:34 -0400
François Schiettecatte <fschiet...@gmail.com> wrote:

> You could certainly render the CSS either in-line in the HMTL pages or
> in templates, just produce CSS as opposed to HTML (I have produced RSS,

My goodness, of course!

Sometimes the "bleedin' obvious" is hard to see

Thanks

> ATOM, XML and JSON in templates). Or you could have multiple CSS files
> and just pick the one you want to use when you render the link to the
> CSS in your HTML pages.
>
> François
>
> On Aug 12, 2014, at 7:37 PM, Drew Ferguson <dr...@afccommercial.co.uk>
> wrote:
>
> > Hi
> >
> > Is there any documentation describing possible ways of having dynamic
> > CSS in a site?
> >
> > For example, having a CSS colour scheme set from a database query or
> > setting a site logo URL from a database query
> >
> > Ta
> > --
> > Drew Ferguson
> >
> > --
> > 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...@googlegroups.com. To post to this group, send
> > email to django...@googlegroups.com. Visit this group at
> > http://groups.google.com/group/django-users. To view this discussion
> > on the web visit
> > https://groups.google.com/d/msgid/django-users/20140813003710.3f766b96%40blacktav.fergiesontour.org.
> > For more options, visit https://groups.google.com/d/optout.
>

--
Drew Ferguson

Avraham Serour

unread,
Aug 13, 2014, 4:25:54 AM8/13/14
to django...@googlegroups.com
just remember to change the headers of the response to reflect that you are serving a css file and not html


Drew Ferguson

unread,
Aug 14, 2014, 10:33:21 AM8/14/14
to django...@googlegroups.com
Hi Avraham

Thanks for the heads-up
AFC Commercial
http://www.afccommercial.co.uk
Reply all
Reply to author
Forward
0 new messages