| | | |
| so at the end of settings.py add: | | so at the end of settings.py add: |
| | | |
| import os | | import os |
| ROOT_PATH = os.path.dirname(os.path.abspath(__ | | ROOT_PATH = os.path.dirname(os.path.abspath(__ |
| file__)) | | file__)) |
n | | n | LIB_PATH = os.path.join(ROOT_PATH, '..', '..', |
| | | 'sphenecoll')
|
| # import directory of settings.py | | # import directory of settings.py |
| import sys | | import sys |
| sys.path.append(ROOT_PATH) | | sys.path.append(ROOT_PATH) |
| | | |
| # settings_local overwrites a few settings fro | | # settings_local overwrites a few settings fro |
| m here, and has to define SECRET_KEY | | m here, and has to define SECRET_KEY |
| | | |
| So now it is time to add the SCT applications. Fir | | 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 ../../ |
| | | |
| So let's add the following to settings.py right af | | 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): |
| | | |
n | sys.path.append(ROOT_PATH + '/../../sphenecoll | n | sys.path.append(LIB_PATH)
|
| ')
| | |
| sys.path.append(ROOT_PATH + '/../../libs/markd | | |
| own')
| | |
| sys.path.append(ROOT_PATH + '/../../libs/custo | | |
| m')
| | |
| sys.path.append(ROOT_PATH + '/../../libs/commo | | |
| n')
| | |
| | | |
| Now look for your INSTALLED_APPS setting and add t | | 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: |
| | | |
| | | |
| INSTALLED_APPS = ( | | INSTALLED_APPS = ( |
| 'django.contrib.auth', | | 'django.contrib.auth', |
| We need to add two template directories .. | | We need to add two template directories .. |
| | | |
| - One for your site templates which are specific t | | - One for your site templates which are specific t |
| o our new cool project | | o our new cool project |
| - The templates used for Sphene Community Tools | | - The templates used for Sphene Community Tools |
| | | |
n | Therefore edit settings.py and after setting ROOT_ | n | 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: |
| | | |
| TEMPLATE_DIRS = ( | | TEMPLATE_DIRS = ( |
t | ROOT_PATH + '/sitetemplates', | t | os.path.join(ROOT_PATH,'sitetemplates'), |
| ROOT_PATH + '/../../sphenecoll/templates', | | os.path.join(LIB_PATH, 'templates'),
|
|
| | |
| ) | | ) |
| | | |
| # Creating base template | | # Creating base template |
| | | |
| SCT expects to find a 'base.html' template with a | | 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: |