app em seu celular e crie uma conta.Acesse: https://www.instagram.com/developer/ e registre uma aplicacaoNa aba Details preencha as informacoes obrigagtoriasNa aba Security coloque uma url valida em Valid redirect URIs. Esta urla lhe dara o access token depois da autorizacaoDesabilite a opcao: Disable implicit OAuthAcesse https://www.instagram.com/oauth/authorize/?client_id=[CLIENT_ID]&redirect_uri=[URI_DO_PASSO 2.2]&response_type=codeVoce sera redirecionado para a URI informada com o seu access token no get:EX: [URI_DO_PASSO 2.2]/?code=rx1p450j0gz2ahgq8ufn0mvw50mvv47eConfigure seu settings.py com as informacoes abaixo:# INSTAGRAMINSTAGRAM_USER_ID = '[USER_ID DO FEED]'INSTAGRAM_CLIENT_ID = '[CLIENT_ID DO PASSO 2]'INSTAGRAM_CLIENT_SECRET = '[CLIENT_SECRET DO PASSO 2]'INSTAGRAM_ACCESS_TOKEN = '[TOKEN OBTIDO NO PASSO 5.1]'Para o [USER_ID DO FEED] utilizei um site que fornece de maneira facil: https://smashballoon.com/instagram-feed/find-instagram-user-id/Instale o python-instagrampy no seu ENV:pip install python-instagram==1.3.2Crie um arquivo chamado feed_instagram.py na mesma pasta do settings.py com o seguinte conteudo:#!/usr/bin/env python# coding: utf-8from os.path import abspath, dirnamefrom datetime import datetime, date, timedeltaimport sys, os, commands, timeSETTINGS_DIRECTORY = dirname(dirname(abspath(__file__)))sys.path.insert(0, SETTINGS_DIRECTORY)os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'from django.conf import settingsfrom django.db.models import Count, Min, Sum, Avgfrom django.template.defaultfilters import slugifyimport re, jsondef log(texto): print "====================================" print texto print "===================================="def carga(): log("INICIO DA ROTINA") from redes_sociais.models import Post from instagram.client import InstagramAPI # AUTH REQUIRED access_token = settings.INSTAGRAM_ACCESS_TOKEN client_secret = settings.INSTAGRAM_CLIENT_SECRET api = InstagramAPI(access_token=access_token, client_secret=client_secret) recent_media, next_ = api.user_recent_media(user_id=settings.INSTAGRAM_USER_ID, count=10) for media in recent_media: #print dir(media) #print media.caption.text post = Post.objects.filter(pid=media.id) texto = media.caption.text if media.caption else None try: if post: post = post[0] post.texto = u'{0}'.format(texto) post.data = media.created_time post.imagem = media.get_standard_resolution_url() else: post = Post( redesocial = 'INSTAGRAM', pid = media.id, texto = u'{0}'.format(texto), data = media.created_time, link = media.link, imagem = media.get_standard_resolution_url(), ) post.save() except Exception, e: log(u"Erro ao inserir [{0}]: {1}".format(media.id, media.get_standard_resolution_url())) log(e) # AUTH NON REQUIRED # api = InstagramAPI(client_id=settings.INSTAGRAM_CLIENT_ID, client_secret=settings.INSTAGRAM_CLIENT_SECRET) # popular_media = api.media_popular(count=20) # for media in popular_media: # print media.images['standard_resolution'].url log("FIM DA ROTINA")if __name__ == '__main__': os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_application() carga()TwitterCrie um aplicativo em: https://apps.twitter.com/Apos criado, na aba settings tem as informacoes necessarias para configuracao:Access Token [TOKEN]Access Token Secret [TOKEN_SECRET]Access Level Read and writeOwner [SEU USUARIO]Owner ID [SEU ID]Configure seu settings.py com as informacoes abaixo:# TWITTERTWITTER_USERNAME = 'zejuniortdr'TWITTER_CONSUMER_KEY = '0aYPbXNNNYvhGyPg9CYufUncN'TWITTER_CONSUMER_SECRET = 'Lf6MfaSRp3qQaAGlbrVyt0hyo3659obj5bL2W6tiO8PWEAE0vU'TWITTER_ACCESS_TOKEN = '30026596-WKqQtcC3AmboRBOqp9uE1cEPfJkZIfeNB8mdR1nVK'TWITTER_ACCESS_SECRET = '9j7D0yzgvIybg6vnB9iqac1354Shv21YE2OwSO1oUarTw'Instale o python-instagrampy no seu ENV:pip install tweepy==3.3.0Crie um arquivo chamado feed_twitter.py na mesma pasta do settings.py com o seguinte conteudo:#!/usr/bin/env python# coding: utf-8from os.path import abspath, dirnamefrom datetime import datetime, date, timedeltaimport sys, os, commands, timeSETTINGS_DIRECTORY = dirname(dirname(abspath(__file__)))sys.path.insert(0, SETTINGS_DIRECTORY)os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'from django.conf import settingsimport redef log(texto): print "====================================" print texto print "===================================="def carga(): log("INICIO DA ROTINA") from redes_sociais.models import Post import tweepy from tweepy import OAuthHandler consumer_key = settings.TWITTER_CONSUMER_KEY consumer_secret = settings.TWITTER_CONSUMER_SECRET access_token = settings.TWITTER_ACCESS_TOKEN access_secret = settings.TWITTER_ACCESS_SECRET auth = OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_secret) api = tweepy.API(auth) username = settings.TWITTER_USERNAME user = tweepy.API(auth).get_user(username) # log(dir(user)) status = api.user_timeline(screen_name=username, count=200, include_entities=True) for s in status: imagem = None if 'media' in s.entities.keys(): imagem = s.entities['media'][0]['media_url'] post = Post.objects.filter(pid=s.id) try: if post: post = post[0] post.texto = u'{0}'.format(s.text) post.data = s.created_at post.imagem = imagem else: post = Post( redesocial = 'TWITTER', pid = s.id, texto = u'{0}'.format(s.text), data = s.created_at, link = 'https://twitter.com/{0}/status/{1}'.format(username, s.id), imagem = imagem, ) post.save() except Exception, e: log(u"Erro ao inserir [{0}]: {1}".format(status.id, status.text)) log("FIM DA ROTINA")if __name__