Fix question scoring bugs
[oweals/karmaworld.git] / docs / dbimport.md
1 # Bootstrapping a DB
2
3 A fresh database may be bootstrapped by running `manage.py syncdb --migrate`.
4 Initial schools must be populated, which can be done by running:
5
6 1. `manage.py fetch_usde_csv ./school.csv`
7 1. `manage.py import_usde_csv ./school.csv`
8 1. `manage.py sanitize_usde_schools`
9
10 For testing purposes, it might be desirable to populate a database with
11 additional data. In this case, see
12 [the next section](#importing-a-preliminary-db).
13
14 # Importing a Preliminary DB
15
16 A preliminary set of Notes, Courses, and Schools is available as json from 
17 the [this repository](https://github.com/FinalsClub/notesjson)
18
19 ## import to a fresh database
20
21 To import this db:
22
23 1. download or clone the notesjson repo
24 2. move the contents of the repo to the root of karmanotes
25 3. run the following management command: `./manage.py import_json all`
26
27 ## import to a database which has data
28
29 Alternatively, you can remove all current Notes, Courses, and Schools from 
30 the database before importing with the following management command:
31
32     ./manage.py import_json all clean