| "django.core.context_processors.media", | | "django.core.context_processors.media", |
| "django.core.context_processors.static", | | "django.core.context_processors.static", |
| "django.contrib.messages.context_processor | | "django.contrib.messages.context_processor |
| s.messages", | | s.messages", |
| 'sphene.community.context_processors.navig | | 'sphene.community.context_processors.navig |
| ation', | | ation', |
| ) | | ) |
t | | t |
|
| | | ## Synchronizing tables
|
| | |
|
| | | After adding the community projects, run syncdb ag |
| | | ain which will create all necessary tables.
|
| | |
|
| | | ./manage.py syncb
|
| | |
|
| | | ## Create base template
|
| | |
|
| | | SCT requires a template called base.html which has |
| | | at least a block called "content" and one called |
| | | "head". To make this easier we will create a small |
| | | community app which hosts only your template. If |
| | | you are integrating SCT into your own project, yo |
| | | u probably already have a base template.
|
| | |
|
| | | ./manage.py startapp mysitecommunity
|
| | |
|
| | | and add 'mysitecommunity' to INSTALLED_APPS in set |
| | | tings.py
|
| | |
|
| | | Now create a template directory and edit base.html |
| | |
|
| | |
|
| | | Herbys-i7:simpleproject herbert$ mkdir mysitec |
| | | ommunity/templates
|
| | | Herbys-i7:simpleproject herbert$ vi mysitecomm |
| | | unity/templates/base.html
|
| | |
|
| | | which looks like:
|
| | |
|
| | |
|
| | |
|
| | | <html>
|
| | | <head>
|
| | | <title>Example Project</title>
|
| | | {% block head %}
|
| | | {% endblock %}
|
| | | </head>
|
| | | <body>
|
| | | {% block content %}
|
| | | {% endblock %}
|
| | | </body>
|
| | | </html>
|
| | |
|
| | | For a more complete example you can look into the |
| | | [simpleproject example in the subversion repositor |
| | | y](https://github.com/hpoul/sct-communitytools/blo |
| | | b/master/examples/simpleproject/sitetemplates/base |
| | | .html).
|
| | |
|
| | | ## And we are done
|
| | |
|
| | | Now start your project with ./manage.py runserver |
| | | and head over to http://127.0.0.1/board/ - You sho |
| | | uld see a very *simple* forum application.
|
| | |
|
| | | # Community Groups
|
| | |
|
| | | In SCT everything is based on 'Community Groups' - |
| | | every forum or wiki snip is part of a 'Group' - T |
| | | his Group has nothing to do with the user groups w |
| | | hich is basically only for assigning permissions - |
| | | a community group is more similar to the concept |
| | | of the [Sites Application](http://www.djangoprojec |
| | | t.com/documentation/sites/) since every community |
| | | Group has one URL assigned. The main difference is |
| | | tough, that Community Groups are ment to be hoste |
| | | d on the same django instance with the same config |
| | | uration, while Sites have a different configuratio |
| | | n for each 'Site'.
|
| | |
|
| | | When running syncdb SCT will by default create a ' |
| | | example' Community Groups which we have configured |
| | | in our urls.py to use. You can configure or creat |
| | | e more Community Groups in the Django Admin interf |
| | | ace:
|
| | |
|
| | | Anyway .. first of all ... we need to get into the |
| | | admin web interface.. so we need to assign an URL |
| | | : open urls.py and uncomment the following line:
|
| | |
|
| | | (r'^admin/', include('django.contrib.admin.ur |
| | | ls')),
|
| | |
|
| | | Now run the project using: "./manage.py runserver" |
| | | and head over to your admin page, propably: http: |
| | | //127.0.0.1:8000/admin/
|
| | |
|
| | | There you need to login with your superuser - user |
| | | you created with the first 'syncdb' call and head |
| | | over to 'Community' -> 'Groups' (__NOT__ Auth -> |
| | | Groups) and click 'Add group'. Enter something lik |
| | | e:
|
| | |
|
| | | - Name: example
|
| | | - Longname: Example Community Group
|
| | | - Baseurl: www.example.com
|
| | |
|
| | | The only important for now is the 'name' .. i assu |
| | | me below that we have a group called 'example' whi |
| | | ch .. will be the only one we want (for now) ...
|
| | |
|