Giter Club home page Giter Club logo

jinho10 / flask-djcelery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from waqasjaved160/flask-djcelery

0.0 1.0 0.0 1.56 MB

An example project for configuring Djcelery with Flask application and dynamically changing tasks via REST API and through django admin

License: MIT License

Python 0.06% Makefile 0.82% C 76.86% C++ 1.56% Shell 0.66% Perl 3.24% M4 1.04% XSLT 0.01% HTML 5.28% Roff 0.13% CSS 0.03% Batchfile 0.02% Lua 0.22% Ruby 1.32% Tcl 8.72% Smarty 0.02%

flask-djcelery's Introduction

flask-djcelery

An example project for configuring Djcelery with Flask application and dynamically adding tasks

  • REST API
  • Django admin

Quick Setup

Django Admin

  1. Clone this repository.
  2. Create a virtualenv and install the requirements.
  3. Create database using command: PYTHONPATH=. django-admin.py migrate --settings=celeryconfig
  4. Start the django server using command: PYTHONPATH=. django-admin.py runserver --settings=celeryconfig
  5. Open second terminal window and start local Redis server using command: ./run-redis.sh.
  6. Start celery worker in another terminal window: env/bin/celery worker -A app.celery --loglevel=INFO.
  7. Start celery beat in another terminal window: PYTHONPATH=. django-admin.py celerybeat --settings=celeryconfig.
  8. Django Admin can be checked by visiting http://localhost:8000/ and celery tasks can be added/removed
  9. Flask application can be started as: python app.py

REST API

  1. Follow all the above steps

  2. GET /interval_schedules/ will list all the schedule intervals

  3. POST /interval_schedules/ will add a schedule interval

    POST Data (Example)
    • every: 90
    • period: seconds
  4. GET /periodic_tasks/ will list all the periodic tasks

  5. POST /periodic_tasks/ will add a new task

    POST Data (Example)
    • name: 'API Task'
    • task: 'app.add'
    • enabled: True
    • args: '[5,5]'
    • interval: 1 (would need to be created first using API)
  6. Similarly PUT /interval_schedules/1/ will change the interval for tasks on the run

    • every: 100
    • period: seconds

flask-djcelery's People

Contributors

waqasjaved160 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.