Re: Template processing/pre-processing
On 2 nov, 12:37, rd-londonwrote: > 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
Not worry, found work-a-round using MEDIA_URL. On Oct 30, 4:39 pm, rd-londonwrote: > 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
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 -~--~~~~--~~--~--~---