A simple wrapper/cache of the Ghibli API.
The application uses celery for periodic tasks. Thus, it requires a message broker (e.g. redis, RabbitMQ etc). By default (see "gh_films.settings.demo") you're supposed to use the redis server as a message broker.
Beside that you need python (3.6+), "pip", "setuptools" and, probably, virtualenv (to build python's virtual environment)
To install python packages you may just say something like
pip install -r ./requirements.txt
Also, please note, that there's an additional file requirements_test.txt
which contains additional packages for testing. In other words, if you want to
run tests you'll need to install those packages first.
Before run this application you need to do next steps:
- create virtual environment and activate it;
- install required packages (system and python);
- create you own local settings (e.g. you may just copy
gh_films/settings/demo.py
togh_films/settings/local.py
); - run migrations (e.g.
./manage.py migrate
); - run celery beat with single worker (e.g.
celery -A gh_films worker -l info -B -c 1
); - wait until celery downloads data from Ghibli's server (about 50 secodns);
- in separate terminal window/tab run server (e.g.
./manage.py runserver
); - in web browser go to the url: http://127.0.0.1:8000/movies/
Note, the dh_films.settings.demo
is configured to use sqlite DB in the
current directory (in the project's directory). Thus user that runs server
should have permissions to write into that folder.
Before run tests you're supposed to have installed packages from
requirements_test.txt
. After that you may just say ./manage.py test
.
If you want to test the package in several environments at once you may use
the tox.ini
. Please note, in this case you need to install the tox
package
manually via pip install tox
.
The current version ("0.0.1") supports tracking and adding new items
("films", "people" and relations between them) only. It can't detect updating
of any item's fields if the id
property is the same.