Questions tagged [django-cron]

Django-cron lets you run Django/Python code on a recurring basis proving basic plumbing to track and execute tasks.

Django-cron lets you run Django/Python code on a recurring basis proving basic plumbing to track and execute tasks.

The 2 most common ways in which most people go about this is either writing custom python scripts or a management command per cron (leads to too many management commands!).

Along with that some mechanism to track success, failure etc. is also usually necessary.

GitHub repo: https://github.com/Tivix/django-cron

Documentation: https://django-cron.readthedocs.io/en/latest/

65 questions
0
votes
0 answers

Issue with django crontabs there not working

hello guys i trying to use django_crontab on my django project and there not working does anyone know something about this im using Linux centos 8. I want to schedule a task to add some data to my database. Can someone help me The steps that i have…
0
votes
2 answers

Schedule automated jobs in Django

Anyone knows how to schedule a Django script to run at a certain date and time? Example: User enters someone’s contact info on frontend, Django backend receives the form data, but doesn’t send the contact an email until 48 hours later. Anyone has an…
0
votes
0 answers

unknow `runcrons` when running `python3 manage.py runcrons

When I run python3 manage.py runcrons, this message appears: "Unknown command: 'runcrons'". I run python3 manage.py help and couldn't find runcrons in the list of commands. How can I add runcrons to manage.py enter image description here
0
votes
0 answers

django-crontab job not running on developement server

I have the following task in cron.py. from coreapp.models import Event, User def update_survey_summary(): print("starting") u = User.objects.get(email="admin@email.com") e = Event( creator=u, title="Some event", …
Samir Ahmane
  • 830
  • 7
  • 22
0
votes
1 answer

Docker configure CRON JOB in python-alpine

I've created a simple Django application, and I want to set up a cron job. I'm using django-cron package. I tried 2 approaches, the first one without docker-compose, I used this approach, but then I realised it wasn't working as the alpine shell was…
0
votes
1 answer

use django_cron to achieve token expiration and log out

I wrote a django that uses the TokenAuthentication verification of the django rest framework. When logging out, delete the previous token and recreate the token. Now I want to use django_cron to achieve token expiration and log out.How do I get…
Lee
  • 1
  • 2
0
votes
1 answer

Is there any another way to python manage.py crontab run in django server?

i have created a scheduled job in django with django_crontab package. i have added the job. its successfully added but its only get executed whenever i run python manage.py crontab run daeea9e88c171494b1610bdebfasd123 not with runserver command.…
Saran Prasad
  • 125
  • 2
  • 13
0
votes
1 answer

How can i check the model object is 30 days old or not in Django?

Info: I am trying to make monthly billing app. Where a customer can buy a property on a monthly basis payment. i want to change the pending attribute True to False if the customer last payment 30 days old. It is a schedule based app but i am not…
afi
  • 573
  • 4
  • 18
0
votes
2 answers

Django-crontab can't make model query

I have a model inside tools app called ApiKeys and tried to update the model in specific time intervels. I used django-crontab for this purpose. CRONJOBS = [ ('*/1 * * * *', 'tools.cron.reset_api_calls','>>logs.log') ] function - from .models…
0
votes
1 answer

django_crontab is adding my jobs, but they don't seem to execute. Any solution?

I got a django project running with django-crontab (github) on Ubuntu 20. in directory I added a cron.py file: from .models import from datetime import datetime def remove_stamps(): for stamp in…
jefferson
  • 105
  • 1
  • 9
0
votes
1 answer

Django-crontab is not working on in linux ec2 instance

I'm trying to set up cron jobs in my django application on a ec2 instance(linux). Everything is working fine, I tried python3 manage.py cron add python3 manage.py cron show python3 manage.py cron remove everything works just fine But when I start…
Mowli sri
  • 71
  • 1
  • 8
0
votes
1 answer

What is the best Way to run a CronJob in containerized django application with 2 or more Replicas

I am working on a project which is deployed on docker swarm as a service with 3 replicas. I want to run a simple management command to delete some rows from a table if the date has passed. I have written a django command for it, but want to make the…
Aniket Singla
  • 555
  • 1
  • 5
  • 20
0
votes
0 answers

Django Cron package latest version not running on times specified

I am using Django Cron package in a docker container where I specify my cron functions like this: class CreateSnapshots(CronJobBase): RUN_EVERY_MINS = 15 # every 15 mins schedule = Schedule(run_every_mins=RUN_EVERY_MINS) code =…
sshussain270
  • 1,785
  • 4
  • 25
  • 49
0
votes
2 answers

Scheduling Tasks in Django

I am new to Django. I built a program that lets teachers assign homework to students. The homework has a due date that is different for each student. I want to make it so that 1 hour before the homework is due for that particular student, they get…
user12989805
0
votes
3 answers

Permission denied while installing django-cron in Vagrant

When running pip install django-cron I get the following error: ERROR: Error [Errno 13] Permission denied: '/vagrant/.venv/bin/python' while executing command python setup.py egg_info ERROR: Could not install packages due to an EnvironmentError:…
MareksNo
  • 140
  • 2
  • 12