In this post I will tell you how to make friends with Django and PHP using the django-php application.$ which php-cgi  $ pip install django_php #  $ easy_install django_php 'django_php' to the INSTALLED_APPS list. In addition, you can specify (or you can not specify) the path to php-cgi: PHP_CGI = '/usr/local/bin/php-cgi'  {% load php %} {% php %} and {% startphp %}...{% endphp %} . Single line calls look like this: {% php echo 9; %}  {% php phpinfo(); %}  {% php for ($i = 0; $i < 8; ++$i) { %} <li>{% php echo $i; %}</li> {% php } %}  {% startphp %} $str = '{{ str|addslashes }}'; $str = strrev($str); echo strtoupper($str); {% endphp %} _GET , _POST , send headers.Source: https://habr.com/ru/post/125773/
All Articles