Ryan's suggestion is a very good one. 

If you don't need Django-specific commands, you can even write a 
stand-alone Python script which accesses your database to do the work. An 
alternative to cron that we use, on occasion, is 
https://pypi.org/project/APScheduler/ which runs in a container (a Python 
scheduler like this is also useful if you want to run on a non-Unix 
operating system). 

On Tuesday, 20 October 2020 at 01:53:50 UTC+2 Ryan Nowakowski wrote:

> On Mon, Oct 19, 2020 at 04:53:35PM +0300, MUGOYA DIHFAHSIH wrote:
> > Hello fellow django developers, i am working on a web app in which 
> reports
> > are archived in the database at the end of every month automatically, i
> > have searched on internet and many folks are suggesting celery which i 
> have
> > tried but not fruitful, is there any other library i use to accomplish 
> this.
> > 
>
> Yeah, celery is great! But sometimes it's too complex a beast for
> simple things. Usually I write a custom Django management command[1].
> In your case it would probably be named something like archivereports.
> Then add a cron entry to run it at the end of every month.
>
> [1] 
> https://docs.djangoproject.com/en/2.2/howto/custom-management-commands/
> [2] https://help.ubuntu.com/community/CronHowto
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23e28b81-1e25-49c2-8b54-e07a8a432386n%40googlegroups.com.

Reply via email to