Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of NonPackagedKidTemplates


Ignore:
Timestamp:
08/08/06 04:33:44 (13 years ago)
Author:
robinbryce
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NonPackagedKidTemplates

    v3 v4  
     1[[PageOutline]] 
     2 
    13== Motivation == 
    24 
     
    143145}}} 
    144146 
     147 
     148== The critical trick == 
     149 
     150The problem not addressed so far is how to prevent TruboKid from complaining about your non packaged kid template file. And indeed,  how to prevent it from blowing up when it encounters 'bigsitesupport/kid/welcome' as a template name. With the import hook installed this turns out to be pretty simple: in your tg-app.cfg file add `kid.precompiled=True` to the `[global]` section. If your config file was generated by runing tg-admin quickstart then after this change the first few lines of this file should look like: 
     151 
     152{{{ 
     153[global] 
     154# The settings in this file should not vary depending on the deployment 
     155# environment. dev.cfg and prod.cfg are the locations for 
     156# the different deployment settings. Settings in this file will 
     157# be overridden by settings in those other files. 
     158 
     159kid.precompiled=True 
     160# The commented out values below are the defaults 
     161}}} 
     162 
     163== Explanation == 
     164 
     165This works because when you tell TurboKid your template files are 'precompiled', TurboKid relies on pythons standard `__import__` machinery to load the template. By lying to turbokid about the 'precompiled' nature of your kid template you by pass all the 'is this kid file a proper pkg_resource' checks and instead go directly to your import hook. 
     166