Fix retrieve_photos task

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 3473c5ebf7
commit 27a7c6e3be
  1. 3
      apps/content/tasks.py
  2. 4
      project/settings.py

@ -11,11 +11,10 @@ from django.conf import settings
from apps.config.models import Config
config = Config.load()
@app.task
def retrieve_photos():
config = Config.load()
api = InstagramAPI(
access_token=config.INSTAGRAM_CLIENT_ACCESS_TOKEN,
client_secret=config.INSTAGRAM_CLIENT_SECRET,

@ -202,7 +202,7 @@ REST_FRAMEWORK = {
),
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.BrowsableAPIRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
'DEFAULT_FILTER_BACKENDS': (
'django_filters.rest_framework.DjangoFilterBackend',
@ -222,7 +222,7 @@ CELERY_TASK_SERIALIZER = 'json'
CELERY_BEAT_SCHEDULE = {
'retrieve_photos_from_instagram': {
'task': 'apps.content.tasks.retrieve_photos',
'schedule': timedelta(minutes=2) if DEBUG else crontab(minute=0, hour=0),
'schedule': timedelta(minutes=5) if DEBUG else crontab(minute=0, hour=0),
'args': (),
},
}

Loading…
Cancel
Save