from datetime import timedelta

from django.conf import settings
from django.core.management import call_command

from celery.task import periodic_task


@periodic_task(run_every=timedelta(minutes=settings.TWEET_INTERVAL_MINUTES))
def tweet_next_task():
    call_command('tweet_next', verbose=True, interactive=False)

from django.core.management import call_command

from celery import shared_task


@shared_task()
def tweet_next_task():
    call_command('tweet_next', verbose=True, interactive=False)

Use shared_task instead of deprecated periodic_task
Use shared_task instead of deprecated periodic_task

- from datetime import timedelta
- 
- from django.conf import settings
  from django.core.management import call_command
  
- from celery.task import periodic_task
+ from celery import shared_task
  
  
- @periodic_task(run_every=timedelta(minutes=settings.TWEET_INTERVAL_MINUTES))
+ @shared_task()
  def tweet_next_task():
      call_command('tweet_next', verbose=True, interactive=False)
  
Use shared_task instead of deprecated periodic_task
## Code Before:
from datetime import timedelta

from django.conf import settings
from django.core.management import call_command

from celery.task import periodic_task


@periodic_task(run_every=timedelta(minutes=settings.TWEET_INTERVAL_MINUTES))
def tweet_next_task():
    call_command('tweet_next', verbose=True, interactive=False)

## Instruction:
Use shared_task instead of deprecated periodic_task
## Code After:
from django.core.management import call_command

from celery import shared_task


@shared_task()
def tweet_next_task():
    call_command('tweet_next', verbose=True, interactive=False)
