diff --git a/apps/content/tasks.py b/apps/content/tasks.py index f80a10cb..a3210c2b 100644 --- a/apps/content/tasks.py +++ b/apps/content/tasks.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, diff --git a/project/settings.py b/project/settings.py index 061ff429..4a156847 100644 --- a/project/settings.py +++ b/project/settings.py @@ -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': (), }, }