Project

General

Profile

Importing Works » History » Version 1

Luke Murphey, 06/05/2019 06:08 AM

1 1 Luke Murphey
h1. Importing Works
2 1 Luke Murphey
3 1 Luke Murphey
h2. Import Works
4 1 Luke Murphey
5 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.
6 1 Luke Murphey
7 1 Luke Murphey
h3. Using Existing Library
8 1 Luke Murphey
9 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.
10 1 Luke Murphey
11 1 Luke Murphey
h2. Importing Works from Perseus
12 1 Luke Murphey
13 1 Luke Murphey
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.
14 1 Luke Murphey
15 1 Luke Murphey
Start the import process by running the following command, substituting "/Users/Luke/Perseus_Directory" with the location where you placed the files:
16 1 Luke Murphey
17 1 Luke Murphey
<pre>
18 1 Luke Murphey
python manage.py batch_import_perseus -d "/Users/Luke/Perseus_Directory"
19 1 Luke Murphey
</pre>
20 1 Luke Murphey
21 1 Luke Murphey
The import process may take a while (it takes about 70 minutes on a Core i7 with 8 GB of RAM). *Make sure to set DEBUG to False* before running the import. Otherwise, memory consumption will grow until the import completes.
22 1 Luke Murphey
23 1 Luke Murphey
h2. Linking Related Works
24 1 Luke Murphey
25 1 Luke Murphey
You can link works via the command "":
26 1 Luke Murphey
27 1 Luke Murphey
<pre>
28 1 Luke Murphey
python manage.py autodiscover_related_works
29 1 Luke Murphey
</pre>
30 1 Luke Murphey
31 1 Luke Murphey
You can also manually do this for a particular work from the admin UI.
32 1 Luke Murphey
33 1 Luke Murphey
h2. Indexing Works
34 1 Luke Murphey
35 1 Luke Murphey
You'll need to index the works for the search engine to work properly.
36 1 Luke Murphey
37 1 Luke Murphey
After importing the works, run the following:
38 1 Luke Murphey
39 1 Luke Murphey
<pre>
40 1 Luke Murphey
python manage.py make_search_indexes -c
41 1 Luke Murphey
</pre>