Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 192 lines (123 sloc) 4.847 kB
a088ac5 Added installation.rst
James Socol authored
1 ============
2 Installation
3 ============
4
5 Requirements
e353583 Rewrite installation.rst
James Socol authored
6 ============
f0f2e6e Adding a production document.
James Socol authored
7
e353583 Rewrite installation.rst
James Socol authored
8 To run everything and make all the tests pass locally, you'll need the
9 following things (in addition to Git, of course).
f0f2e6e Adding a production document.
James Socol authored
10
e353583 Rewrite installation.rst
James Socol authored
11 * Python 2.6.
a088ac5 Added installation.rst
James Socol authored
12
e353583 Rewrite installation.rst
James Socol authored
13 * `setuptools <http://pypi.python.org/pypi/setuptools#downloads>`_
14 or `pip <http://pip.openplans.org/>`_.
a088ac5 Added installation.rst
James Socol authored
15
e353583 Rewrite installation.rst
James Socol authored
16 * MySQL Server and client headers.
a088ac5 Added installation.rst
James Socol authored
17
e353583 Rewrite installation.rst
James Socol authored
18 * Memcached Server.
a088ac5 Added installation.rst
James Socol authored
19
e353583 Rewrite installation.rst
James Socol authored
20 * `Sphinx <http://sphinxsearch.com/>`_ 0.9.9, compiled with the
21 ``--enable-id64`` flag.
a088ac5 Added installation.rst
James Socol authored
22
e353583 Rewrite installation.rst
James Socol authored
23 * RabbitMQ.
a088ac5 Added installation.rst
James Socol authored
24
e353583 Rewrite installation.rst
James Socol authored
25 * ``libxml`` and headers.
a088ac5 Added installation.rst
James Socol authored
26
e353583 Rewrite installation.rst
James Socol authored
27 * ``libxslt`` and headers.
a088ac5 Added installation.rst
James Socol authored
28
e353583 Rewrite installation.rst
James Socol authored
29 * ``libjpeg`` and headers.
a088ac5 Added installation.rst
James Socol authored
30
e353583 Rewrite installation.rst
James Socol authored
31 * ``zlib`` and headers.
a088ac5 Added installation.rst
James Socol authored
32
e353583 Rewrite installation.rst
James Socol authored
33 * Several Python packages. See `Installing the Packages`_.
a088ac5 Added installation.rst
James Socol authored
34
e353583 Rewrite installation.rst
James Socol authored
35 Installation for these is very system dependent. Using a package manager, like
36 yum, aptitude, or brew, is encouraged.
a088ac5 Added installation.rst
James Socol authored
37
38
e353583 Rewrite installation.rst
James Socol authored
39 Additional Requirements
40 -----------------------
a088ac5 Added installation.rst
James Socol authored
41
e353583 Rewrite installation.rst
James Socol authored
42 If you want to use Apache, instead of the dev server (not strictly required but
43 it's more like our production environment) you'll also need:
a088ac5 Added installation.rst
James Socol authored
44
e353583 Rewrite installation.rst
James Socol authored
45 * Apache HTTPD Server.
a088ac5 Added installation.rst
James Socol authored
46
e353583 Rewrite installation.rst
James Socol authored
47 * ``mod_wsgi``
a088ac5 Added installation.rst
James Socol authored
48
e353583 Rewrite installation.rst
James Socol authored
49 See the documentation on `WSGI <wsgi.rst>`_ for more information and
50 instructions.
a088ac5 Added installation.rst
James Socol authored
51
52
e353583 Rewrite installation.rst
James Socol authored
53 Getting the Source
54 ==================
a088ac5 Added installation.rst
James Socol authored
55
e353583 Rewrite installation.rst
James Socol authored
56 Grab the source from Github using::
a088ac5 Added installation.rst
James Socol authored
57
4e2ec3c @groovecoder bug 634263 update installation doc for Kuma
groovecoder authored
58 git clone git://github.com/mozilla/kuma.git
59 cd kuma
b984df2 Tweaked instructions to not use HEAD for vendored files
BuddyL authored
60 git submodule update --init --recursive
a088ac5 Added installation.rst
James Socol authored
61
e353583 Rewrite installation.rst
James Socol authored
62 Installing the Packages
63 =======================
a088ac5 Added installation.rst
James Socol authored
64
e353583 Rewrite installation.rst
James Socol authored
65 Compiled Packages
66 -----------------
a088ac5 Added installation.rst
James Socol authored
67
e353583 Rewrite installation.rst
James Socol authored
68 There are a small number of compiled packages, including the MySQL Python
69 client. You can install these using ``pip`` (if you don't have ``pip``, you
70 can get it with ``easy_install pip``) or via a package manager.
71 To use ``pip``, you only need to do this::
a088ac5 Added installation.rst
James Socol authored
72
e353583 Rewrite installation.rst
James Socol authored
73 sudo pip install -r requirements/compiled.txt
a088ac5 Added installation.rst
James Socol authored
74
75
e353583 Rewrite installation.rst
James Socol authored
76 Python Packages
77 ---------------
a088ac5 Added installation.rst
James Socol authored
78
e353583 Rewrite installation.rst
James Socol authored
79 All of the pure-Python requirements are available in a git repository, known as
80 a vendor library. This allows them to be available on the Python path without
81 needing to be installed in the system, allowing multiple versions for multiple
82 projects simultaneously.
a088ac5 Added installation.rst
James Socol authored
83
e353583 Rewrite installation.rst
James Socol authored
84 Configuration
85 =============
a088ac5 Added installation.rst
James Socol authored
86
e353583 Rewrite installation.rst
James Socol authored
87 Start by creating a file named ``settings_local.py``, and putting this line in
88 it::
a088ac5 Added installation.rst
James Socol authored
89
e353583 Rewrite installation.rst
James Socol authored
90 from settings import *
a088ac5 Added installation.rst
James Socol authored
91
e353583 Rewrite installation.rst
James Socol authored
92 Now you can copy and modify any settings from ``settings.py`` into
93 ``settings_local.py`` and the value will override the default.
a088ac5 Added installation.rst
James Socol authored
94
95
e353583 Rewrite installation.rst
James Socol authored
96 Database
97 --------
a088ac5 Added installation.rst
James Socol authored
98
e353583 Rewrite installation.rst
James Socol authored
99 At a minimum, you will need to define a database connection. An example
100 configuration is::
a088ac5 Added installation.rst
James Socol authored
101
e353583 Rewrite installation.rst
James Socol authored
102 DATABASES = {
103 'default': {
4e2ec3c @groovecoder bug 634263 update installation doc for Kuma
groovecoder authored
104 'NAME': 'kuma',
e353583 Rewrite installation.rst
James Socol authored
105 'ENGINE': 'django.db.backends.mysql',
106 'HOST': 'localhost',
4e2ec3c @groovecoder bug 634263 update installation doc for Kuma
groovecoder authored
107 'USER': 'kuma',
e353583 Rewrite installation.rst
James Socol authored
108 'PASSWORD': '',
109 'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
110 'TEST_CHARSET': 'utf8',
111 'TEST_COLLATION': 'utf8_unicode_ci',
112 },
113 }
a088ac5 Added installation.rst
James Socol authored
114
7bf2d68 Add a note about TEST_CHARSET and TEST_COLLATION to installation.rst
James Socol authored
115 Note the two settings ``TEST_CHARSET`` and ``TEST_COLLATION``. Without these,
116 the test suite will use MySQL's (moronic) defaults when creating the test
117 database (see below) and lots of tests will fail. Hundreds.
118
e353583 Rewrite installation.rst
James Socol authored
119 Once you've set up the database, you can generate the schema with Django's
120 ``syncdb`` command::
a088ac5 Added installation.rst
James Socol authored
121
e353583 Rewrite installation.rst
James Socol authored
122 ./manage.py syncdb
ec3f1a9 @buddylindsey Added line for doing south migrations.
buddylindsey authored
123 ./manage.py migrate
a088ac5 Added installation.rst
James Socol authored
124
e353583 Rewrite installation.rst
James Socol authored
125 This will generate an empty database, which will get you started!
a088ac5 Added installation.rst
James Socol authored
126
8cf44b3 @Boldewyn Add detail to installation process
Boldewyn authored
127 If you run into a "No such file or directory" error for
6eaa324 @Boldewyn struggling with rst
Boldewyn authored
128 ../product_details_json just create this folder::
8cf44b3 @Boldewyn Add detail to installation process
Boldewyn authored
129
130 mkdir ../product_details_json
131
6eaa324 @Boldewyn struggling with rst
Boldewyn authored
132 and run::
8cf44b3 @Boldewyn Add detail to installation process
Boldewyn authored
133
134 ./manage.py update_product_details
135
ffc3c59 Added instructions to readme so you can use css and images during dev…
BuddyL authored
136 Media
137 -----
138
139 If you want to see images and have the pages formatted with CSS you need to
d47fd0a @buddylindsey Prettified some of the changes from last night that the formatting wa…
buddylindsey authored
140 set your ``settings_local.py`` with the following::
ffc3c59 Added instructions to readme so you can use css and images during dev…
BuddyL authored
141
142 DEBUG = True
143 TEMPLATE_DEBUG = DEBUG
144 SERVE_MEDIA = True
a088ac5 Added installation.rst
James Socol authored
145
e353583 Rewrite installation.rst
James Socol authored
146 Testing it Out
147 ==============
a088ac5 Added installation.rst
James Socol authored
148
e353583 Rewrite installation.rst
James Socol authored
149 To start the dev server, run ``./manage.py runserver``, then open up
150 ``http://localhost:8000``. If everything's working, you should see a somewhat
151 empty version of the SUMO home page!
a088ac5 Added installation.rst
James Socol authored
152
153
e353583 Rewrite installation.rst
James Socol authored
154 Running the Tests
155 -----------------
a088ac5 Added installation.rst
James Socol authored
156
e353583 Rewrite installation.rst
James Socol authored
157 A great way to check that everything really is working is to run the test
158 suite. You'll need to add an extra grant in MySQL for your database user::
a088ac5 Added installation.rst
James Socol authored
159
e353583 Rewrite installation.rst
James Socol authored
160 GRANT ALL ON test_NAME.* TO USER@localhost;
a088ac5 Added installation.rst
James Socol authored
161
e353583 Rewrite installation.rst
James Socol authored
162 Where ``NAME`` and ``USER`` are the same as the values in your database
163 configuration.
a088ac5 Added installation.rst
James Socol authored
164
e353583 Rewrite installation.rst
James Socol authored
165 The test suite will create and use this database, to keep any data in your
166 development database safe from tests.
a088ac5 Added installation.rst
James Socol authored
167
e353583 Rewrite installation.rst
James Socol authored
168 Running the test suite is easy::
a088ac5 Added installation.rst
James Socol authored
169
e353583 Rewrite installation.rst
James Socol authored
170 ./manage.py test -s --noinput --logging-clear-handlers
a088ac5 Added installation.rst
James Socol authored
171
e353583 Rewrite installation.rst
James Socol authored
172 For more information, see the `test documentation <tests.rst>`_.
a088ac5 Added installation.rst
James Socol authored
173
33a983d @erikrose [587219] Move the update_product_details step below the DB setup in i…
erikrose authored
174
e353583 Rewrite installation.rst
James Socol authored
175 Last Steps
176 ==========
33a983d @erikrose [587219] Move the update_product_details step below the DB setup in i…
erikrose authored
177
178 Initializing Mozilla Product Details
179 ------------------------------------
180
4e2ec3c @groovecoder bug 634263 update installation doc for Kuma
groovecoder authored
181 One of the packages Kuma uses, Django Mozilla Product Details, needs to
e353583 Rewrite installation.rst
James Socol authored
182 fetch JSON files containing historical Firefox version data and write them
183 within its package directory. To set this up, just run
184 ``./manage.py update_product_details`` to do the initial fetch.
185
186
187 Setting Up Search
188 -----------------
33a983d @erikrose [587219] Move the update_product_details step below the DB setup in i…
erikrose authored
189
e353583 Rewrite installation.rst
James Socol authored
190 See the `search documentation <search.rst>`_ for steps to get Sphinx search
191 working.
Something went wrong with that request. Please try again.