Skip to content

Alexoner/sloth

Repository files navigation

sloth

A crawler task management and data demonstration frontend in RESTful Django.

job management

Tasks are maintained in database with celery beating service

start redis

install redis and then

redis-server
redis-cli <<EOF
CONFIG SET protected-mode no
EOF

start a worker

python manage.py celery -A sloth worker --loglevel=info

or

celery -A sloth worker --loglevel=info

start a beat service to schedule periodic tasks

celery -A sloth beat -l info

run tasks in shell

$ python manage.py shell
>>> from job.tasks import add
>>> add.delay(2, 2)

run tests

./manage.py test

running in docker

if you have a container that with something running on its port 8000

docker run -td -P -v /root/work:/home/admin/work -w /home/admin sloth:latest

you can run

wget http://container_ip:8000

To get the container´s ip address, run the 2 commands:

docker ps

docker inspect container_name | grep IPAddress

Internally, Docker shells out to call iptables when you run an image, so maybe some variation on this will work.

to expose the container's port 8000 on your localhosts port 8001

 iptables -t nat -A  DOCKER -p tcp --dport 8000 -j DNAT --to-destination 192.168.42.47:8000

start frontend

see client/README.md

data demonstration

TODO

About

REST application in Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published