Skip to content

Latest commit

 

History

History
76 lines (40 loc) · 1.48 KB

File metadata and controls

76 lines (40 loc) · 1.48 KB

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