Re: Including a php script in a template
On 07/11/06 10:59, [EMAIL PROTECTED] wrote: > Hello all! > > Is it somehow possible to include an exisiting php-script which prints > a table and some textual data (after some large calculations) in a > django template? > I rather don't want to port the existing php-script as it makes it job > well and is written by someone else. > > Thanks in advance > The guys who wrote the django apps for pycon use both php and django templates. Have a look at their repo [1], specifically [2] and [3]. Maybe you can use their template loader in combination with django's include tag? Not sure if this is what you're after, but it may get you started. cheers Steven [1] http://us.pycon.org/repo [2] http://us.pycon.org/repo/django/trunk/pycon/core/template_loaders.py [3] http://us.pycon.org/repo/django/trunk/pycon/templates/pycon/ --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Including a php script in a template
I think, the only way to do that is to call the php script in shell from the Django view, retrieve the results into a string, and to pass it to the template. To execute a command in the shell from withing Python, you should write something like this: import os put, get = os.popen4("ls") # replace ls with php --parameters filetoexecute.php result = "".join([line for line in get.readlines()]) Try that, maybe it will lead you to success. Aidas Bendoraitis [aka Archatas] On 7/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello all! > > Is it somehow possible to include an exisiting php-script which prints > a table and some textual data (after some large calculations) in a > django template? > I rather don't want to port the existing php-script as it makes it job > well and is written by someone else. > > Thanks in advance > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Including a php script in a template
Hello all! Is it somehow possible to include an exisiting php-script which prints a table and some textual data (after some large calculations) in a django template? I rather don't want to port the existing php-script as it makes it job well and is written by someone else. Thanks in advance --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---