A system that fetch the course data and provide service that is insinctive, easy to use.
Typing the commands below may help you build this system.
pip install -r requirements.txt
python manage.py syncdb
python manage.py makemigrations
python manage.py migrate
python manage.py crawl_course
python manage.py update_index
To clear all contents in db, use python manage.py crawl_course clear
To update all syllabus, use python manage.py update_syllabus
For auto decaptcha feature, it requires tesseract 3.03
- tesseract
- mac:
brew install tesseract --devel # Without --devel, it will install tesseract 3.02
- ubuntu:
sudo apt-get install tesseract-ocr
- mac:
We use mysql as database. The default setting will find a config file in 'NTHU_Course/mysql.ini'. The following is a sample config file:
[client]
database = <database name>
user = <mysql username>
password = <mysql password>
host = <mysql server ip>
port = <mysql server port>
default-character-set = utf8
To use it in heroku, you have to set the following environment variables
TESSDATA_PREFIX=/app/.apt/usr/share/tesseract-ocr/tessdata
BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
DJANGO_SETTINGS_MODULE=NTHU_Course.settings.heroku
SECRET_KEY=hard-to-guess-string
this can be achieved by heroku config:set
or the web panel