Code

Changes between Version 43 and Version 44 of ServerArrangements


Ignore:
Timestamp:
08/09/09 09:57:25 (5 years ago)
Author:
bitprophet
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ServerArrangements

    v43 v44  
    113113== Django behind/inside Zope == 
    114114 
    115 It's possible to query a Django site from Zope or Plone and return the result. This allows you to include a Django site inside a pre-existing Zope/Plone site. It's good for custom content that you don't want to use existing Zope technologies to develop. 
    116 For the code, see [http://bitprophet.org/code/django_to_zope.py this partly documented file]. It's in a temporary location for the time being; for more info, e-mail ''jeff (at) bitprophet (dot) org''. 
     115It's possible to query a Django site from Zope or Plone and return the result. This allows you to include a Django site inside a pre-existing Zope/Plone site. It's good for custom content that you don't want to use existing Zope technologies to develop. The main trick is to write a "Script (Python)" object that loads up Django's request handling mechanisms, while ensuring (as with any Django deployment) that your Django site is on the current PYTHONPATH and that the env var DJANGO_SETTINGS_MODULE is set to your project's settings file. I'm afraid I've lost the original code that did this but the approach was pretty simple. 
     116 
     117However, an even better approach showed up later (found due to Plone's caching mechanisms causing problems with the above -- it would occasionally call the script multiple times, which on POSTs is a very bad thing...) which is simply to use Apache as the primary frontend, and using mod_proxy to send some requests to the Plone app server running on another port, with other requests going to your Django site, however you wish to deploy it with Apache (I used mod_python, would be using mod_wsgi today). E.g. proxy /cms and /documents to Plone, with a catchall serving up your Django site. (Or vice-versa, if you desire -- it's all just Apache at this point.) 
    117118 
    118119== CGI ==