Update documentation
[snf-cloudcms] / docs / source / index.rst
1 .. snf-cloudcms documentation master file, created by
2    sphinx-quickstart on Wed Feb 22 18:07:30 2012.
3    You can adapt this file completely to your liking, but it should at least
4    contain the root `toctree` directive.
5
6 Welcome to snf-cloudcms's documentation!
7 ========================================
8
9 Introduction
10 ============
11
12 snf-cloudcms is a cms application based on `django`_ and `feincms`_.
13
14 The project created to power websites that provide information about the
15 `cloud services`_ deployed by `GRNET`_. 
16
17 Currentrly the application provides the following features:
18
19 * basic cms funcionality (adding/removing/editing hierarchical pages)
20 * blog application
21
22 in the near future the following additional features will get included 
23 within the application:
24
25 * Service resources management (presentations, technical papaer, white papers
26   etc.)
27 * Service support (faq, userguide, service tickets etc.)
28
29 .. _django: http://www.djangoproject.com
30 .. _feincms: http://feinheit.ch/media/labs/feincms/
31 .. _cloud services: http://docs.dev.grnet.gr/
32 .. _GRNET: http://www.grnet.gr/
33
34
35 Installation
36 ============
37
38 Using debian packages
39 ---------------------
40
41 Although not required it is recommended to use `snf-webproject`_ to deploy the
42 cms application. If you want to deploy using your custom django project take
43 a look on `cloudcms/synnefo_settings.py`_ file which includes `snf-webproject`
44 hooks to find which django settings are required for cms to work.
45
46 .. _snf-webproject: http://docs.dev.grnet.gr/snf-webproject
47
48 Install required packages::
49     
50     apt-get install snf-common snf-webproject
51     apt-get install python-django-feincms python-django-pagination python-django
52
53 .. note::
54     
55     ``python-django-feincms`` and ``python-django-pagination`` are not provided
56     currently on debian stable but can be backported from sid.
57
58 then, install ``snf-cloudcms`` package::
59
60     apt-get install snf-cloudcms
61
62 Change settings in ``/etc/synnefo/20-snf-cloudcms-*.conf`` to match your
63 deployment needs.
64
65
66 Deployment
67 ==========
68
69 For information on how to configure and initialize database and serve 
70 ``snf-cloudcms`` static files please refer to `snf-webproject`_ documentation.
71
72 .. note::
73
74     ``snf-cloudcms`` won't work with ``snf-webproject < 0.9.0``
75
76
77 ``snf-cloudcms`` uses the django sites framework so that multiple cms sites
78 can be deployed from the same django project and share common content. For each
79 service site you want to deploy you should set the appropriate
80 ``CLOUDCMS_SITE_ID`` environmental variable to match the site id added in your
81 cms databse.
82
83 A quick way to initialize the sites you want to deploy is to create a simple
84 fixtures file ``mysites.json`` containing the following::
85
86     [ 
87         {
88             "pk": 1, 
89             "model": "sites.site", 
90             "fields": {
91                 "domain": "okeanos.grnet.gr", 
92                 "name": "okeanos.grnet.gr"
93             }
94         }, 
95     ]
96
97 and load the fixtures in your db using:: 
98     
99     snf-manage loaddata ./mysites.json
100
101 After that you can deploy each of the sites you included in the above fixtures
102 file using your prefered deployment method (fcgi, gunicorn etc.). 
103
104 e.g. using django internal http server::
105     
106     export CLOUDCMS_SITE_ID=1
107     snf-manage runserver
108         
109 If you skipped superuser creation as prompted on your database initialization
110 step, you should create one now::
111
112     snf-manage createsuperuser
113
114 Now you will be able to login using the superuser credentials you provided on
115 the above command on ``http://<deployment-domain>/cmsmanage/`` url and start
116 editing the content of your cms.
117
118
119 Static files
120 ************
121
122 snf-cloudcms requires the following static files to be served by your django
123 project:
124
125     * feincms static files for the admin interface
126     * django.contrib.admin static files
127     * snf-cloudcms static files
128
129 If you are using `snf-webproject`_ to deploy your cms all static file handlers
130 should be taken care for you and no additional steps required in the deployment
131 process. This automatic behaviour can be enabled/disabled from the 
132 ``WEBPROJECT_SERVE_STATIC`` setting.
133
134 If you want to disable serving static files from your django project, set
135 ``WEBPROJECT_SERVE_STATIC`` to False in your settings and configure your 
136 web server to serve static files of the following locations to the specific 
137 urls which can be altered in your settings files:
138
139 * <feincms install dir>/feincms/static/ -> FEINCMS_ADMIN_MEDIA (default:/static/feincms/)
140 * <django install dir>/django/contrib/admin/media/ -> ADMIN_MEDIA_PREFIX (default:/static/djangoadminmedia/)
141 * <cloudcms install dir>/cloudcms/static/ -> MEDIA_URL (default:/static/)
142
143
144 CMS uploads
145 ***********
146
147 snf-cloudcms uses feincms medialibrary application to store and display
148 files in cms pages. The location of those files is based on MEDIA_ROOT setting
149 and is calculated using the following expression::
150
151     MEDIA_ROOT + '/medialibrary/'
152
153 if you deploy using `snf-webproject`_ this defaults to 
154 ``/usr/share/synnefo/static/medialibrary`` which you should create and grant
155 appropriate permissions for web app to be able to access it. e.g. if you deploy
156 using nginx/gunicorn and your gunicorn workers run with www-data user 
157 permissions::
158
159     mkdir /usr/share/synnefo/static/medialibrary
160     chown www-data:www-data /usr/share/synnefo/static/medialibrary
161     chmod o+rw /usr/share/synnefo/sattic/medialibrary
162
163
164 Indices and tables
165 ==================
166
167 * :ref:`genindex`
168 * :ref:`modindex`
169 * :ref:`search`
170