django-php

PHP support for the Django template language

django-php

faq

Q: why would you do that Why would you do that?

A: :cf:

what it does

django-php allows you to include PHP code directly in your Django templates, like this:

{% load php %}
{% php echo 9; %}

See the source code for more examples.

requirements

The php-cgi binary.

installation

django-php is available on PyPI, so the usual incantation will suffice, whichever you like best:

$ pip install django_php
# or
$ easy_install django_php

Add django_php to your INSTALLED_APPS.

settings.py

Not generally required:

PHP_CGI = '/usr/local/bin/php-cgi'
Fork me on GitHub