Skip to main content
Help us improve Python packaging – donate today!

Instagram client for Django.

Project Description

A Django application that allows to use some template tags to display content from an Instagram public profile.


Install Django with your favourite linux packaging system or you can use pip for installing python packages, if Django is not an official package for your distribution:

Use pip to install Django Instagram:

pip install django-instagram

Pip should take care of the package dependencies for Django Instagram.


Add the application to INSTALLED_APPS:


Rebuild your application database, this command depends on which version of Django you are using.

In Django 2.0 (recommended):

python makemigrations django_instagram

Them migrate the db:

python migrate

Go to the Django Instagram administration panel and click on “Get Access Token” button to receive your access token from Instagram. Then copy and paste it to the configuration field and save.

Remember to be logged in with the Instagram account that you want to get the access token for.


After you are done with this, you can use the tags who need user access to Instagram, this tag will give two context variables called:

  • profile:
  • recent_media:

You can display the data contained in recent_media list like this:

<!DOCTYPE html>

{% load instagram_client %}

<html lang="en">
    <meta charset="UTF-8">
    <title>AMD Instagram feed</title>
<h1>AMD Instagram Feed</h1>
<div id="django_recent_media_wall">
    {% instagram_user_recent_media amd %}
    {% for media in recent_media %}
        <div class="django_instagram_media_wall_item">
            <a href="//{{ media.shortcode }}" target="_blank">
                <img src="{{ media.thumbnail_src }}"/>
                <span>{{ media.edge_media_to_caption.edges.0.node.text }}</span>
    {% endfor %}
<p>Got from instagram</p>

There are also two inclusion tags that includes an example of how to parse data from Instagram, you can also use them like this:

{% load instagram_client %}

<h1>Instagram media wall</h1>
{% instagram_recent_media_wall username="intel" %}

<h1>Instagram sliding box</h1>
{% instagram_recent_media_box username="intel" %}


As you may have noticed some filters can be used for sizing the pictures, here is the list of the usable fitlers:

For standard size:

{% for media in recent_media %}
<img src="{{ media.thumbnail_src|standard_size }}"/>
{% endfor %}

For low resolution images:

{% for media in recent_media %}
<img src="{{ media.thumbnail_src|low_resolution }}"/>
{% endfor %}

For thumbnail size:

{% for media in recent_media %}
<img src="{{ media.thumbnail_src|thumbnail }}"/>
{% endfor %}


  • 0.3.0 Updates to the scraping algorithm.
  • 0.2.0 New scraping algorithm, removed Python Instagram.
  • 0.1.1 Numerous bug fixes, better documentation.
  • 0.1.0 Work in progress version.

Release history Release notifications

This version
History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_instagram-0.3.0-py2.py3-none-any.whl (35.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 9, 2018
django-instagram-0.3.0.tar.gz (35.8 kB) Copy SHA256 hash SHA256 Source None Apr 9, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page