Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 230 lines (142 sloc) 6.469 kB
d5de85d aaded INSTALL doc
adam authored
1 Installing Booki
b1919cb @aerkalov First draft for new install.
aerkalov authored
2 ----------------
d5de85d aaded INSTALL doc
adam authored
3
61d3407 @douglasbagnall reformatting INSTALL: wrap lines
douglasbagnall authored
4 Note : there are three components to the Booki Tool Set. This doc
5 covers only the Booki (editor/book manager) component and not Espri
6 (importer) or Objavi (exporter). By default Booki is hardwired to the
7 FLOSS Manuals install of Objavi and Espri so you still acquire that
8 functionality. To detach yourself from the FLOSS Manuals mothership
9 you need to install Espri and Objavi and configure your install of
10 Booki accordingly.
d5de85d aaded INSTALL doc
adam authored
11
b1919cb @aerkalov First draft for new install.
aerkalov authored
12 This document describes how to install the latest stable versions of
13 Django, simplejson, and Redis, using python's easy_install. If you
14 have a sufficiently recent distribution (e.g., Debian Squeeze), you
15 can just use the distro versions. In that case, skip the easy_install
16 steps and do whatever is appropriate with your package manager.
d5de85d aaded INSTALL doc
adam authored
17
18
b1919cb @aerkalov First draft for new install.
aerkalov authored
19 Booki prerequisites
20 -------------------
2cb1a33 @aerkalov Update install instructions.
aerkalov authored
21
22 Command examples are for Debian/Ubuntu.
23
07dd1cc new INSTALL file
adam authored
24 - Python, minimum 2.5 (http://www.python.org/) and headers
2cb1a33 @aerkalov Update install instructions.
aerkalov authored
25
07dd1cc new INSTALL file
adam authored
26 $ sudo apt-get install python-dev
b1919cb @aerkalov First draft for new install.
aerkalov authored
27
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
28 - PostgreSQL (recommended) or Sqlite3 (not recommended)
07dd1cc new INSTALL file
adam authored
29
30 $ sudo apt-get install postgresql
31 or
32 $ sudo apt-get install sqlite3
b1919cb @aerkalov First draft for new install.
aerkalov authored
33
2cb1a33 @aerkalov Update install instructions.
aerkalov authored
34 - Psycopg (must use this adapter with PostgreSQL)
35
36 $ sudo apt-get install python-psycopg2
37
b1919cb @aerkalov First draft for new install.
aerkalov authored
38 - git repository manager (http://git-scm.com/)
39
40 $ sudo apt-get install git-core
41
42 - Python Set Up Tools
43
07dd1cc new INSTALL file
adam authored
44 $ sudo apt-get install python-setuptools
b1919cb @aerkalov First draft for new install.
aerkalov authored
45
46 - Django, minimum 1.2 (http://http://www.djangoproject.com/)
47
07dd1cc new INSTALL file
adam authored
48 $ sudo easy_install django
2cb1a33 @aerkalov Update install instructions.
aerkalov authored
49 or
07dd1cc new INSTALL file
adam authored
50 $ sudo apt-get install python-django
b1919cb @aerkalov First draft for new install.
aerkalov authored
51
52 - SimpleJSON
53
07dd1cc new INSTALL file
adam authored
54 $ sudo easy_install simplejson
b1919cb @aerkalov First draft for new install.
aerkalov authored
55
56 - Redis (http://redis.io/)
57
07dd1cc new INSTALL file
adam authored
58 $ sudo apt-get install redis-server
b1919cb @aerkalov First draft for new install.
aerkalov authored
59
60 - South (http://south.aeracode.org/)
61
07dd1cc new INSTALL file
adam authored
62 $ sudo easy_install South
b1919cb @aerkalov First draft for new install.
aerkalov authored
63
64 - lxml (http://codespeak.net/lxml/)
65
07dd1cc new INSTALL file
adam authored
66 $ sudo apt-get install libxml2-dev and libxslt-dev
67 $ sudo easy_install lxml
b1919cb @aerkalov First draft for new install.
aerkalov authored
68
69
70 Installing from the git repository
71 ----------------------------------
d5de85d aaded INSTALL doc
adam authored
72
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
73 This install doc uses sqlite3 (it is recommended to use PostgreSQL) as its the
74 easiest to setup so make sure sqlite3 is installed. Do all of the steps as regular
75 user or www-data user.
b1919cb @aerkalov First draft for new install.
aerkalov authored
76
d5de85d aaded INSTALL doc
adam authored
77 1. Clone Booki
b1919cb @aerkalov First draft for new install.
aerkalov authored
78
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
79 git clone git://booki-dev.flossmanuals.net/git/booki.git
d5de85d aaded INSTALL doc
adam authored
80
07dd1cc new INSTALL file
adam authored
81 2. Change dir to 'booki/scripts'
d5de85d aaded INSTALL doc
adam authored
82
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
83 cd booki/scripts
d5de85d aaded INSTALL doc
adam authored
84
2cb1a33 @aerkalov Update install instructions.
aerkalov authored
85 3. Create booki instance. If you have write permissions, script will create directory /var/www/mybooki/. If you don't
86 have write permissions, administrator should create that directory first.
87 sudo mkdir /var/www/mybooki/
88 sudo chown www-data:www-data /var/www/mybooki/
d5de85d aaded INSTALL doc
adam authored
89
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
90 ./createbooki --database sqlite /var/www/mybooki/
d5de85d aaded INSTALL doc
adam authored
91
aaccbbb @aerkalov Changed install docs.
aerkalov authored
92 4. Change directory
d5de85d aaded INSTALL doc
adam authored
93
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
94 cd /var/www/mybooki/
d5de85d aaded INSTALL doc
adam authored
95
aaccbbb @aerkalov Changed install docs.
aerkalov authored
96 5. Edit settings
d5de85d aaded INSTALL doc
adam authored
97
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
98 vi settings.py
d5de85d aaded INSTALL doc
adam authored
99
aaccbbb @aerkalov Changed install docs.
aerkalov authored
100 6. Load environment variables
101
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
102 . ./booki.env
d5de85d aaded INSTALL doc
adam authored
103
aaccbbb @aerkalov Changed install docs.
aerkalov authored
104 7. Initialize database
d5de85d aaded INSTALL doc
adam authored
105
c8ab51c @tavasti Modified installation procedure so that syncdb is successfull, and in…
tavasti authored
106 django-admin.py syncdb --noinput
d5de85d aaded INSTALL doc
adam authored
107
aaccbbb @aerkalov Changed install docs.
aerkalov authored
108 8. Migrate
d5de85d aaded INSTALL doc
adam authored
109
c8ab51c @tavasti Modified installation procedure so that syncdb is successfull, and in…
tavasti authored
110 django-admin.py migrate
aaccbbb @aerkalov Changed install docs.
aerkalov authored
111
c8ab51c @tavasti Modified installation procedure so that syncdb is successfull, and in…
tavasti authored
112 9. Create superuser account
113
114 django-admin.py createsuperuser
115
d4a86d4 @tavasti Add documentation_licenses fixture
tavasti authored
116 10. Add common dokumentation licenses
117
118 django-admin.py loaddata documentation_licenses
119
120 11. Start redis (If you are using the distro's Redis server, this may
aaccbbb @aerkalov Changed install docs.
aerkalov authored
121 not be necessary or desirable).
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
122
123 redis-server &
aaccbbb @aerkalov Changed install docs.
aerkalov authored
124
d4a86d4 @tavasti Add documentation_licenses fixture
tavasti authored
125 12. Start the whole thing
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
126
127 django-admin.py runserver
d5de85d aaded INSTALL doc
adam authored
128
129 Then if all is well open your browser and point to something like:
130 http://127.0.0.1:8000/
131
aaccbbb @aerkalov Changed install docs.
aerkalov authored
132
133 How to use Booki with Apache and mod_wsgi
134 -----------------------------------------
d5de85d aaded INSTALL doc
adam authored
135
a602ce8 @aerkalov Add info for migration.
aerkalov authored
136 To install Booki with Apache, you need to use WSGI or FCGI/SCGI. Consult the
19c6ff3 @douglasbagnall expand INSTALL dployent notes
douglasbagnall authored
137 Django documentation at
138 http://docs.djangoproject.com/en/dev/howto/deployment/.
d5de85d aaded INSTALL doc
adam authored
139
aaccbbb @aerkalov Changed install docs.
aerkalov authored
140 Createbooki script has created booki.wsgi script for the Apache. Use that
141 file as part of your Apache config.
d5de85d aaded INSTALL doc
adam authored
142
143
aaa23ec @tuukka document the new lulu.com settings
tuukka authored
144 How to migrate to latest Booki
145 ------------------------------
146
147 1. The following should be added to settings.py:
148
149 # lulu.com export credentials that override Objavi settings
150 LULU_USER = None
151 LULU_PASSWORD = None
152 LULU_API_KEY = None
153
154
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
155 How to migrate to Booki 1.2
156 ---------------------------
157
158 1. There are new template files. Be aware if you have changed template files.
159
160 reader/book_info.html (new file)
161
162 reader/book_view.html (used to be reader/book.html)
163 reader/book_chapter.html (used to be reader/chapter.html)
164
165 reader/draft_book.html (used to be reader/book.html)
166 reader/draft_chapter.html (used to be reader/chapter.html)
167
168 2. There are new named URL patterns.
169
170 book_view (used to be view_book, does not have book version argument anymore)
171 book_chapter (used to be view_chapter, does not have book version argument anymore)
172
173 book_info (new)
174
175 draft_book (used to be view_book)
176 draft_chapter (used to be view_chapter)
177 draft_attachment
178
179 For instance. If you had in your template:
180
181 {% url view_chapter book.url_title book_version chap.url_title %}
182
183 Now you must use this syntax (notice there is no book version argument):
184
185 {% url book_chapter book.url_title chap.url_title %}
186
187 3. You must add new default template directory to settings.py file. This is how TEMPLATE_DIR should look like:
188
189 TEMPLATE_DIRS = (
190 '%s/templates/' % BOOKI_ROOT,
191 '%s/templates/' % os.path.dirname(booki.__file__)
192 )
193
5c59870 @aerkalov Fix INSTALL docs and install script.
aerkalov authored
194 4. Read lib/booki/messaging/README.txt how to install new Messaging app.
195
ea57cb2 @aerkalov #468. How to migrate to Booki 1.2
aerkalov authored
196
197
a602ce8 @aerkalov Add info for migration.
aerkalov authored
198 How to migrate to Booki 1.1
199 ---------------------------
d5de85d aaded INSTALL doc
adam authored
200
a602ce8 @aerkalov Add info for migration.
aerkalov authored
201 1. Install Booki again with 'createbooki' script
d5de85d aaded INSTALL doc
adam authored
202
fc4a347 @aerkalov Add info for migration and fix apache config.
aerkalov authored
203 2. Change configuration in new setting.py file (compare it with old configuration)
a602ce8 @aerkalov Add info for migration.
aerkalov authored
204
205 3. Change attachment path in database. Please change OLD_PATH and NEW_PATH to point to new directories. If you don't do this, attachments will not be accessable.
206
207 $ django-admin shell
208 >>> from booki.editor import models
209 >>> OLD_PATH = '/Users/aerkalov/Work/git/booki/site_media/static/'
210 >>> NEW_PATH = '/Users/aerkalov/Work/git/mybooki/data/books/'
211 >>>
212 >>> for att in models.Attachment.objects.all():
213 ... print '>> ', att.attachment.name
214 ... name = att.attachment.name.replace(OLD_PATH, NEW_PATH)
215 ... att.attachment.name = name
216 ... att.save()
fc4a347 @aerkalov Add info for migration and fix apache config.
aerkalov authored
217 >>>
218 >>> from django.contrib.auth.models import User
219 >>> OLD_PATH = '/Users/aerkalov/Work/git/booki/site_media/static/_profile_images/'
220 >>> NEW_PATH = '/Users/aerkalov/Work/git/mybooki/data/profile_images/'
221 >>>
222 >>> for u in User.objects.all():
223 ... p = u.get_profile()
224 ... print '>>> ', p.image.name
225 ... name = p.image.name.replace(OLD_PATH, NEW_PATH)
226 ... p.image.name = name
227 ... p.save()
228
d5de85d aaded INSTALL doc
adam authored
229
Something went wrong with that request. Please try again.