{"id":20003211,"url":"https://github.com/mbrsagor/djangocelery","last_synced_at":"2026-06-08T06:34:49.891Z","repository":{"id":45083175,"uuid":"263563514","full_name":"mbrsagor/djangoCelery","owner":"mbrsagor","description":"Asynchronous Tasks With Django and Celery. “Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well.” For this post, we will focus on the scheduling feature to periodically run a job/task.","archived":false,"fork":false,"pushed_at":"2025-03-23T15:39:00.000Z","size":2251,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T16:34:41.703Z","etag":null,"topics":["celery","celery-task","django-celery-results"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrsagor.png","metadata":{"files":{"readme":"Readme.Md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-13T07:58:38.000Z","updated_at":"2025-03-23T15:38:57.000Z","dependencies_parsed_at":"2022-09-22T04:53:51.688Z","dependency_job_id":"eab37777-d9ce-42f7-9ac7-7b04f9fcd5e3","html_url":"https://github.com/mbrsagor/djangoCelery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbrsagor/djangoCelery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FdjangoCelery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FdjangoCelery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FdjangoCelery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FdjangoCelery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrsagor","download_url":"https://codeload.github.com/mbrsagor/djangoCelery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FdjangoCelery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34051769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","celery-task","django-celery-results"],"created_at":"2024-11-13T05:24:39.268Z","updated_at":"2026-06-08T06:34:49.855Z","avatar_url":"https://github.com/mbrsagor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Task scheduling\n\n## Setup\n\n### Dependencies\n\n- Python 3.10\n- postgres 13.2\n- Django 4.1\n\nThe following steps will walk you thru installation on a Mac. Linux should be similar.\nIt's also possible to develop on a Windows machine, but I have not documented the steps.\nIf you've developed the django apps run on Windows, you should have little problem getting\nup and running.\n\n\u003e Please follow the instructions to run the project in your local dev server\n\n```base\ngit clone https://github.com/mbrsagor/djangoCelery.git\ncd djangoCelery\nvirtualenv venv --python=python3.10\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n###### Then create ``.env`` file and paste code from `sample.env` file and add validate information.\n\n-------------------------------------------\n```bash\n|--\u003e sample.env\n|--\u003e .env\n```\n\n###### Run the development server:\n```\nsource venv/bin/activate\n./manage.py migrate\n./manage.py runserver\n```\n\n\n### Install radis server\n\nOn Mac OS\n```\nbrew install redis\nbrew services start redis\n```\n\nBrew permission errors? Try `sudo chown -R \"$USER\":admin /usr/local`\nOpen \u0026 Test Redis: open terminal\n\n```\nredis-cli ping\n```\n\nOutput:\n`PONG`\n\nThen run redis server: `redis-server`\n![alt text](https://res.cloudinary.com/mbrsagor/image/upload/v1589358011/Screenshot_2020-05-13_at_2.16.29_PM_v9uglj.png)\n\n##### Install Celery + Redis in your virtualenv.\n\n```\npip install \"celery[redis]\"\npip install redis\npip install django-celery-beat\npip install django-celery-results\npip freeze \u003e requirements.txt\n```\n\n##### Settings.py which install app added `2` third party app.\n\n```\nOTHER_APPS = [\n    'django_celery_beat',\n    'django_celery_results',\n]\n```\n\nThen\n\n```\nCELERY_BROKER_URL = 'redis://localhost:6379'\nCELERY_RESULT_BACKEND = 'redis://localhost:6379'\nCELERY_ACCEPT_CONTENT = ['application/json']\nCELERY_TASK_SERIALIZER = 'json'\nCELERY_RESULT_SERIALIZER = 'json'\n```\n\n#### Create celery.py to setup Celery app:\n\n- [ ] Navigate to root project config module (where `settings` and `urls` modules are)\n- [ ] Navigate to root project config module (where settings and urls modules are)\n\n- [ ] ![alt text](https://res.cloudinary.com/mbrsagor/image/upload/v1589358693/celery_frfxio.png)\n\nThen clone the project from `git` then the documentation follow. Hopefully, the project will run successfully. If any\nkind of errors please search `google` or `youtube` you will get very good result.\n\n#### Migrate and create superuser\n\n```\n./manage.py makemigrations\n./manage.py migrate\n./manage.py createsuperuser\n```\n\n###### Run Celery Locally\n\n- Run the Celery Consumer Worker (locally). Make sure virtualenv is activated and this command where you run runserver\\*\n\n* First run a new terminal and follow the command\n  `celery -A CeleryTask worker -l info`\n\n* Then open another terminal and run the command.\n  `celery -A CeleryTask beat -l info -S django`\n\n- To see Celery Worker status\n\n###### Here `CeleryTask` is a project name. If you develop same like app you may change there app name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fdjangocelery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrsagor%2Fdjangocelery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fdjangocelery/lists"}