Skip to content

wbeange/Instagram---Python-Flask-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram API Flask example

Using the wonderful Python-Instagram library

Requirements

  • Python 2.7.x
  • Virtualenv
  • PIP
  • Heroku Toolbelt / Foreman
  • Instagram Account

How to install these requirements is here, halfway down page

How to run locally

Download code

Set up virtual environment

Navigate to code directory in Terminal and run following command

  • Create and activate virtual environment for directory.

      virtualenv venv
      . venv/bin/activate
    
  • Install requirements for app

      pip install -r requirements.txt
    

Create Instagram Application/Account

Set up Instagram Credentials

In your Application settings, find the tokens and keys, you will need these to use the Instagram API.

Create .env file with the following

CLIENT_ID=YOURCLIENTIDHERE
CLIENT_SECRET=YOURCLIENTSECRETHERE
SECRET_KEY=SECRET_KEY_FOR_FLASK
REDIRECT_URI=http://localhost:5000/instagram_callback

Save as .env in your code directory.

Start the server

To start server you must have Foreman / Heroku toolbelt installed. Foreman will read your .env files to get your credentials.

Start your engines

foreman start

OR

. start

Enjoy

Open browser, http://localhost:5000

Stop server

Ctrl+C