Tutorial
TutorialBack to Snip <-- Previous Change | Next Change -->
| Diff Summary | |||||
|---|---|---|---|---|---|
| Title | |||||
| Date | 2008-02-17 00:28:06 | 2008-02-17 00:46:19 | |||
| Editor | Herbert Poul | Herbert Poul | |||
| Tags | |||||
| 2008-02-17 00:28:06 by Herbert Poul | 2008-02-17 00:46:19 by Herbert Poul | ||||
|---|---|---|---|---|---|
| 117 | 'django.core.context_processors.request', | 117 | 'django.core.context_processors.request', | ||
| 118 | 'django.core.context_processors.media', | 118 | 'django.core.context_processors.media', | ||
| 119 | 'sphene.community.context_processors.navig | 119 | 'sphene.community.context_processors.navig | ||
| > | ation', | > | ation', | ||
| 120 | ) | 120 | ) | ||
| 121 | 121 | ||||
| n | n | 122 | # Validating template loaders | ||
| 123 | |||||
| 124 | Make sure you have the application template loader | ||||
| > | in your TEMPLATE_LOADERS setting ('django.templat | ||||
| > | e.loaders.app_directories.load_template_source') | ||||
| 125 | |||||
| 126 | for example: | ||||
| 127 | |||||
| 128 | TEMPLATE_LOADERS = ( | ||||
| 129 | 'sphene.community.groupaware_templateloade | ||||
| > | r.load_template_source', | ||||
| 130 | 'django.template.loaders.filesystem.load_t | ||||
| > | emplate_source', | ||||
| 131 | 'django.template.loaders.app_directories.l | ||||
| > | oad_template_source', | ||||
| 132 | ) | ||||
| 133 | |||||
| 134 | |||||
| 122 | # Adding Template Directories | 135 | # Adding Template Directories | ||
| 123 | 136 | ||||
| n | 124 | We need to add two template directories .. | n | 137 | We need to add our template directories .. |
| 125 | 138 | ||||
| 126 | - One for your site templates which are specific t | 139 | - One for your site templates which are specific t | ||
| > | o our new cool project | > | o our new cool project | ||
| n | 127 | - The templates used for Sphene Community Tools | n | ||
| 128 | 140 | ||||
| n | 129 | Therefore edit settings.py and after setting ROOT_ | n | 141 | Therefore edit settings.py and after setting ROOT_ |
| > | PATH = os.path.dirname(..) we created previously ( | > | PATH = os.path.dirname(..) we created previously a | ||
| > | as well as LIB_PATH) add the following: | > | dd the following: | ||
| 130 | 142 | ||||
| 131 | TEMPLATE_DIRS = ( | 143 | TEMPLATE_DIRS = ( | ||
| 132 | os.path.join(ROOT_PATH,'sitetemplates'), | 144 | os.path.join(ROOT_PATH,'sitetemplates'), | ||
| t | 133 | os.path.join(LIB_PATH, 'templates'), | t | ||
| 134 | ) | 145 | ) | ||
| 135 | 146 | ||||
| 136 | # Creating base template | 147 | # Creating base template | ||
| 137 | 148 | ||||
| 138 | SCT expects to find a 'base.html' template with a | 149 | SCT expects to find a 'base.html' template with a | ||
| > | 'content' block, so we need to create a simple tem | > | 'content' block, so we need to create a simple tem | ||
| > | plate. Therefore.. create the directory 'sitetempl | > | plate. Therefore.. create the directory 'sitetempl | ||
| > | ates' and a file called 'base.html' with (for exam | > | ates' and a file called 'base.html' with (for exam | ||
| > | ple) the following content: | > | ple) the following content: | ||
Powered by Sphene Community Tools
