Is it possible to include PHP code in the Django templates?
Or is there another way (which doesn't involved migrating the blog to Django)?
TIA
Rachel
Well.
It's probably possible, just not pretty. One thing you might do is
write a custom template loader which calls out to /usr/bin/php and
runs PHP over the contents before returning the Template object for
Django to work with, but that would probably be quite a bit of work.
Another option, and maybe a nicer one, would be to look at the work
Ian Bicking has been doing recently to produce a gateway that lets PHP
apps speak WSGI; he's got an experimental "PyWordpress" that runs
Wordpress under WSGI: http://blog.ianbicking.org/pywordpress.html
Finally, you could ditch WP entirely and use inspectdb +
django.contrib.admin to manage the blog, and do all the templating via
Django, but of course you'd lose (or have to re-implement) any WP
templating features you were relying on.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
This external template loader example might be useful for you:
http://code.djangoproject.com/ticket/2440 (it's also linked off the
front page of the Wiki if you lose it later).
Regards,
Malcolm
Thanks
Rachel