Project

General

Profile

Setup And Install » History » Version 2

Luke Murphey, 11/17/2012 12:44 AM

1 1 Luke Murphey
h1. Setup And Install
2 1 Luke Murphey
3 2 Luke Murphey
Below are instructions for how to run your own instance of TextCritical.
4 2 Luke Murphey
5 1 Luke Murphey
h2. Install Prerequisites
6 1 Luke Murphey
7 2 Luke Murphey
To run TextCritical, you will need:
8 2 Luke Murphey
9 2 Luke Murphey
* "Django 1.4.*":https://www.djangoproject.com/download/
10 2 Luke Murphey
* "Python 2.7":http://www.python.org/getit/
11 2 Luke Murphey
* A database (you can use SQLite to avoid setting up a database)
12 2 Luke Murphey
13 1 Luke Murphey
h2. Install TextCritical Application
14 1 Luke Murphey
15 2 Luke Murphey
Check out the source code from http://svn.lukemurphey.net/textcritical.com using a "Subversion client":http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients.
16 2 Luke Murphey
17 2 Luke Murphey
Copy start_here_settings.py to settings.py (under the src directory). Update the settings.py file per your host.
18 2 Luke Murphey
19 1 Luke Murphey
h2. Configure Initialize Database
20 1 Luke Murphey
21 2 Luke Murphey
Specify a database in settings.py unless you intend to use SQLite.
22 2 Luke Murphey
23 2 Luke Murphey
After configuring the database, run syncdb (from the src directory):
24 2 Luke Murphey
25 1 Luke Murphey
<pre>
26 1 Luke Murphey
python manage.py syncdb
27 1 Luke Murphey
</pre>
28 1 Luke Murphey
29 1 Luke Murphey
h2. Import Works
30 1 Luke Murphey
31 1 Luke Murphey
You will need to import the works into the library in order to have something for the site to provide access to. The easy way to do this is to use a prebuilt library. The more difficult way is to import the works yourself.
32 1 Luke Murphey
33 1 Luke Murphey
h3. Using Existing Library
34 1 Luke Murphey
35 1 Luke Murphey
To use an existing library, copy the library.sqlite file to the server. By default, it should be placed in the src directory.
36 1 Luke Murphey
37 1 Luke Murphey
h3. Importing Works
38 1 Luke Murphey
39 1 Luke Murphey
If you want to import works manually, then following the steps below.
40 1 Luke Murphey
41 1 Luke Murphey
First, initialize the library database.
42 1 Luke Murphey
43 1 Luke Murphey
<pre>
44 1 Luke Murphey
python manage.py syncdb --database=library
45 1 Luke Murphey
</pre>
46 1 Luke Murphey
47 2 Luke Murphey
Next, download the relevant works. The Perseus works can be obtained from "Perseus.tufts.edu":http://www.perseus.tufts.edu/hopper/opensource/download. Make sure to get the classics library. Decompress the archive.
48 1 Luke Murphey
49 2 Luke Murphey
Start the import process by running the following command, substituting "/Users/Luke/Perseus_Directory" with the location where you placed the files:
50 1 Luke Murphey
51 1 Luke Murphey
<pre>
52 1 Luke Murphey
python manage.py batch_import_perseus -d "/Users/Luke/Perseus_Directory"
53 1 Luke Murphey
</pre>
54 1 Luke Murphey
55 2 Luke Murphey
The import process may take a while (it takes about 40 minutes on a Core i7 with 8 GB of RAM).
56 2 Luke Murphey
57 1 Luke Murphey
h2. Start Web Server
58 2 Luke Murphey
59 2 Luke Murphey
For production installs, you ought to use a production web-server like Apache. For development you can use the built in web-server:
60 2 Luke Murphey
61 2 Luke Murphey
<pre>
62 2 Luke Murphey
python manage.py runserver 0.0.0.0:8080
63 2 Luke Murphey
</pre>