Re: Template processing/pre-processing

2009-11-02 Thread bruno desthuilliers



On 2 nov, 12:37, rd-london  wrote:
> Not worry, found work-a-round using MEDIA_URL.

Actually, that's what MEDIA_URL is for - so it's not a "workaround".
Now if you want more control (or custom stuff), writing a context
processor that exposes whatever setting (builtin or custom) you want
isn't really rocket science - just read the source code for
django.core.context_processors.media...

> On Oct 30, 4:39 pm, rd-london  wrote:
>
> > Hi,
>
> > I'd like to write some code, probably middleware, that look at various
> > types of HTML in templates and prepends a setting from settings.py.
>
> > For example, I'd like to pickup all .js, .css, .jpg, .png, .gif - and
> > stick a custom setting from settings.py on the front - effectively a
> > path.
>
> > Ideally, I'd like to do this by-project, so one project will have one
> > such setting in a settings.py, another project will have nother.
>
> > I'm not looking for a solution (although one would certainly be
> > welcome), but where to start looking would be handy. Feels like its
> > some kind of template pre-processing middleware - but anyone any
> > pointers/tips?
>
> > Many thanks for any help,
> > R
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Template processing/pre-processing

2009-11-02 Thread rd-london

Not worry, found work-a-round using MEDIA_URL.


On Oct 30, 4:39 pm, rd-london  wrote:
> Hi,
>
> I'd like to write some code, probably middleware, that look at various
> types of HTML in templates and prepends a setting from settings.py.
>
> For example, I'd like to pickup all .js, .css, .jpg, .png, .gif - and
> stick a custom setting from settings.py on the front - effectively a
> path.
>
> Ideally, I'd like to do this by-project, so one project will have one
> such setting in a settings.py, another project will have nother.
>
> I'm not looking for a solution (although one would certainly be
> welcome), but where to start looking would be handy. Feels like its
> some kind of template pre-processing middleware - but anyone any
> pointers/tips?
>
> Many thanks for any help,
> R
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Template processing/pre-processing

2009-10-30 Thread rd-london

Hi,

I'd like to write some code, probably middleware, that look at various
types of HTML in templates and prepends a setting from settings.py.

For example, I'd like to pickup all .js, .css, .jpg, .png, .gif - and
stick a custom setting from settings.py on the front - effectively a
path.

Ideally, I'd like to do this by-project, so one project will have one
such setting in a settings.py, another project will have nother.

I'm not looking for a solution (although one would certainly be
welcome), but where to start looking would be handy. Feels like its
some kind of template pre-processing middleware - but anyone any
pointers/tips?

Many thanks for any help,
R


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---