This project allows to search for lessons by titles on Stepic.
Python >=3.4 required.
Elasticsearch == 1.7.1 must be installed.
- Install Elasticsearch
- For macos simple install:
brew install elasticsearch
- Install other requirements:
pip install -r requirements.txt
- Prepare your db:
python manage.py migrate
- Load lessons in local models:
-
From [Stepic] (http://stepic.org) by running command in project root directory:
python manage.py loadlessons
This command will load all available lessons, or you can bound loading pages count with:
python manage.py loadlessons -p {pages_count}
-
From file:
python manage.py loadlessons -f {path_to_file}
File should be with JSON content like:
{ "lessons": [ { "id": 1, "title": "A Journey of a Thousand Miles. . ." }, { "id": 2, "title": "Hidden Messages in the Replication Origin" }, { "id": 3, "title": "Some Hidden Messages are More Surprising than Others" } ] }
- Run elasticsearch
$ bin/elasticsearch
- Index lessons with command:
python manage.py createindex
- Run server:
python manage.py runserver
If you need to delete lessons from your db, you can use command:
python manage.py clearlessons