Name: [212] Doug Napoleone
Member: 92 months
Authored: 5 videos
Description:

Django plus PHP [ID:152] (3/5)

in series: PyCon-Tech: The Python behind PyCon

video tutorial by Doug Napoleone, added 03/07

(Showmedo is undergoing major changes. To report any problems viewing the videos please email us and include browser and OS specifics. Cheers - Kyran.)

We dive into the source code behind the PyCon web site and how we integrate the PHP based PMWiki with Django using a custom Template Loader.

The loader allows for loading PHP source from any other template loader, including django flatpages (stored in database). Included is a demonstration of integrating django into a WordPress site.

Information on accessing the source code can be found on the PyCon-Tech wiki page.


Uploaded on 18th February 2007, running time 24 minutes.

Got any questions?

Get answers in the ShowMeDo Learners Google Group.

Video statistics:

  • Video's rank shown in the most popular listing
  • Video plays: 1520 (since July 30th)
  • Plays in last week: 1
  • Published: Sometime before 1st March 2007 (in other words - we don't remember!)

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Your email address will not be published.

Show some quick comments >>








All comments excluding tick-boxed quick-comments

8. Mert Nuhoglu Tue, 22 Jun 2010 05:52

Very useful. Did you publish the source code as well?


Hi Doug, really nice work. I'm going to watch it again to understand the details better.

I have intergated django app into mediawiki once using apache server side includes - It was real pain the the butt to get it right!

Your solution looks great, the only concern that may be left is working with dynamic content - where both php and django stuff is dynamic. May be asking for some tweaks in caching?

Thanks for your effort creating and publishing the screencast.

Cheers,

Evgeny.


6. anonymous Fri, 14 Aug 2009 13:59

That was a great presentation of how PHP can be pushed through Django.

This is a big issue for my company right now, I am trying to convince everyone that python/django is the way forward, but they insist there is too much investment in PHP.

This is my "magic bullet"

Thanks :)


5. anonymous Thu, 23 Jul 2009 20:23

thanks all.


4. anonymous Thu, 12 Mar 2009 12:23

The PHP source is loaded from the same template lookup as any django template.

So you just need to ass the directory containing the PHP files to your TEMPALTE_DIRS in your settings file (no need to copy anything). This is the key to getting it to work actually as your PHP may be loading other PHP modules and it should be doing so in the standard way.

As for the URL hierarchy, that all comes down to how you have your server configured. Your Django code needs to be under a different set of URL's and your server needs to properly dispatch to the proper service. You can do just about anything you want to do, thus my vague statement. For apache just set up your rules and rewrite rules properly to have the urls you want served up as php, going to php, and the django urls going to django. You have to do that no matter what. The template loader trick is just to help you have one set of master PHP page templates used by both your PHP code and by django.


3. anonymous Thu, 12 Mar 2009 12:22

The PHP source is loaded from the same template lookup as any django template.

So you just need to ass the directory containing the PHP files to your TEMPALTE_DIRS in your settings file (no need to copy anything). This is the key to getting it to work actually as your PHP may be loading other PHP modules and it should be doing so in the standard way.

As for the URL hierarchy, that all comes down to how you have your server configured. Your Django code needs to be under a different set of URL's and your server needs to properly dispatch to the proper service. You can do just about anything you want to do, thus my vague statement. For apache just set up your rules and rewrite rules properly to have the urls you want served up as php, going to php, and the django urls going to django. You have to do that no matter what. The template loader trick is just to help you have one set of master PHP page templates used by both your PHP code and by django.


I didn't quite follow where do the PHP source come from - from the WordPress/PmWiki folder on the disk or does it have to be copied over to the Django project/application? Also, how do the URL hierarchies of the PHP and Django applications play along?


Wow!!! Good job. Could I take some of yours triks to build my own site?


Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

By the Same Author

Content

Feedback

Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.

feedback@showmedo.com