Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools

Tutorial

Tutorial

Back to Snip <-- Previous Change | Next Change -->

Diff Summary
Title
Date 2012-06-04 09:25:53 2012-06-04 09:28:45
Editor Herbert Poul Herbert Poul
Tags

2012-06-04 09:25:53 by Herbert Poul
2012-06-04 09:28:45 by Herbert Poul
100        'sphene.community.middleware.GroupMiddlewa100        'sphene.community.middleware.GroupMiddlewa
>re',>re',
101101
102To add the template context processor you need to 102To add the template context processor you need to 
>modify TEMPLATE_CONTEXT_PROCESSOR - this variable >modify TEMPLATE_CONTEXT_PROCESSOR - this variable 
>is by default not set in the generated settings.py>is by default not set in the generated settings.py
> - so if you don't have it yet in your settings.py> - so if you don't have it yet in your settings.py
> you have to add it:> you have to add it:
103103
104104
nn105    # import the default values from django settin
 >gs
106    from django.conf.global_settings import TEMPLA
 >TE_CONTEXT_PROCESSORS
107
105    TEMPLATE_CONTEXT_PROCESSORS = (108    TEMPLATE_CONTEXT_PROCESSORS += (
106        "django.contrib.auth.context_processors.au109        # add navigation middleware for SCT
>th",  
107        "django.core.context_processors.debug",
108        "django.core.context_processors.i18n",
109        "django.core.context_processors.media",
110        "django.core.context_processors.static",
111        "django.contrib.messages.context_processor
>s.messages",  
112        'sphene.community.context_processors.navig110        'sphene.community.context_processors.navig
>ation',>ation',
113    )111    )
nn112
114113
115## Synchronizing tables114## Synchronizing tables
116115
117After adding the community projects, run syncdb ag116After adding the community projects, run syncdb ag
>ain which will create all necessary tables.>ain which will create all necessary tables.
118117
119    ./manage.py syncb118    ./manage.py syncb
tt119
120If you have also added south to your INSTALLED_APP
 >S also use
121
122    ./manage.py migrate
120123
121## Create base template124## Create base template
122125
123SCT requires a template called base.html which has126SCT requires a template called base.html which has
> at least a block called "content" and one called > at least a block called "content" and one called 
>"head". To make this easier we will create a small>"head". To make this easier we will create a small
> community app which hosts only your template. If > community app which hosts only your template. If 
>you are integrating  SCT into your own project, yo>you are integrating  SCT into your own project, yo
>u probably already have a base template.>u probably already have a base template.
124127


Powered by Sphene Community Tools