Tutorial
TutorialBack to Snip <-- Previous Change | Next Change -->
| Diff Summary | |||||
|---|---|---|---|---|---|
| Title | |||||
| Date | 2007-04-15 13:01:41 | 2007-05-12 10:13:37 | |||
| Editor | Herbert Poul | Herbert Poul | |||
| Tags | |||||
| 2007-04-15 13:01:41 by Herbert Poul | 2007-05-12 10:13:37 by Herbert Poul | ||||
|---|---|---|---|---|---|
| 27 | 27 | ||||
| 28 | so at the end of settings.py add: | 28 | so at the end of settings.py add: | ||
| 29 | 29 | ||||
| 30 | import os | 30 | import os | ||
| 31 | ROOT_PATH = os.path.dirname(os.path.abspath(__ | 31 | ROOT_PATH = os.path.dirname(os.path.abspath(__ | ||
| > | file__)) | > | file__)) | ||
| n | n | 32 | LIB_PATH = os.path.join(ROOT_PATH, '..', '..', | ||
| > | 'sphenecoll') | ||||
| 32 | # import directory of settings.py | 33 | # import directory of settings.py | ||
| 33 | import sys | 34 | import sys | ||
| 34 | sys.path.append(ROOT_PATH) | 35 | sys.path.append(ROOT_PATH) | ||
| 35 | 36 | ||||
| 36 | # settings_local overwrites a few settings fro | 37 | # settings_local overwrites a few settings fro | ||
| > | m here, and has to define SECRET_KEY | > | m here, and has to define SECRET_KEY | ||
| 76 | 77 | ||||
| 77 | So now it is time to add the SCT applications. Fir | 78 | So now it is time to add the SCT applications. Fir | ||
| > | st of all we need to add the python library path. | > | st of all we need to add the python library path. | ||
| > | You might want to configure it in your mod_python | > | You might want to configure it in your mod_python | ||
| > | config, or where ever .. since i want to keep it s | > | config, or where ever .. since i want to keep it s | ||
| > | imple and i actually have my project under 'commun | > | imple and i actually have my project under 'commun | ||
| > | itytools' .. i can simply include ../../ | > | itytools' .. i can simply include ../../ | ||
| 78 | 79 | ||||
| 79 | So let's add the following to settings.py right af | 80 | So let's add the following to settings.py right af | ||
| > | ter were we added sys.path.append(ROOT_PATH): | > | ter were we added sys.path.append(ROOT_PATH): | ||
| 80 | 81 | ||||
| n | 81 | sys.path.append(ROOT_PATH + '/../../sphenecoll | n | 82 | sys.path.append(LIB_PATH) |
| > | ') | ||||
| 82 | sys.path.append(ROOT_PATH + '/../../libs/markd | ||||
| > | own') | ||||
| 83 | sys.path.append(ROOT_PATH + '/../../libs/custo | ||||
| > | m') | ||||
| 84 | sys.path.append(ROOT_PATH + '/../../libs/commo | ||||
| > | n') | ||||
| 85 | 83 | ||||
| 86 | Now look for your INSTALLED_APPS setting and add t | 84 | Now look for your INSTALLED_APPS setting and add t | ||
| > | he default django admin application as well as the | > | he default django admin application as well as the | ||
| > | three SCT apps .. all in all it should look like: | > | three SCT apps .. all in all it should look like: | ||
| > | > | ||||
| 87 | 85 | ||||
| 88 | INSTALLED_APPS = ( | 86 | INSTALLED_APPS = ( | ||
| 89 | 'django.contrib.auth', | 87 | 'django.contrib.auth', | ||
| 125 | We need to add two template directories .. | 123 | We need to add two template directories .. | ||
| 126 | 124 | ||||
| 127 | - One for your site templates which are specific t | 125 | - One for your site templates which are specific t | ||
| > | o our new cool project | > | o our new cool project | ||
| 128 | - The templates used for Sphene Community Tools | 126 | - The templates used for Sphene Community Tools | ||
| 129 | 127 | ||||
| n | 130 | Therefore edit settings.py and after setting ROOT_ | n | 128 | Therefore edit settings.py and after setting ROOT_ |
| > | PATH = os.path.dirname(..) we created previously a | > | PATH = os.path.dirname(..) we created previously ( | ||
| > | dd the following: | > | as well as LIB_PATH) add the following: | ||
| 131 | 129 | ||||
| 132 | TEMPLATE_DIRS = ( | 130 | TEMPLATE_DIRS = ( | ||
| t | 133 | ROOT_PATH + '/sitetemplates', | t | 131 | os.path.join(ROOT_PATH,'sitetemplates'), |
| 134 | ROOT_PATH + '/../../sphenecoll/templates', | 132 | os.path.join(LIB_PATH, 'templates'), | ||
| > | |||||
| 135 | ) | 133 | ) | ||
| 136 | 134 | ||||
| 137 | # Creating base template | 135 | # Creating base template | ||
| 138 | 136 | ||||
| 139 | SCT expects to find a 'base.html' template with a | 137 | 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
