Skip to main content

Django package to sync and display personal Instagram media

Project description


A Django application that allows to fetch individual Instagram user profile media data and save into database. Instagram media is managed using Django admin console. Demo

Instagram profile

First you need to configure Instagram application following these instructions: Instagram Basic Display API



Install Django and other required packages. It is very handy to use pipenv for this.

pipenv install django requests pillow configparser

By default, newly created Django project configuration uses SQLite. If you're using other database engine make sure you configure it properly beforehand.

Install Instagram profile package:

pipenv install django-instagram-profile

Create env.ini file inside your project directory with the following settings:

account = instagram_account_name
auth_url =
access_token_url =
app_id = 123
secret = abc
redirect_url =
media_url =


Add the application to INSTALLED_APPS:

INSTALLED_APPS = ('instagram_profile',)

Create a folder for Instagram media


Configure correct paths for uploaded instagram media in

SITE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
MEDIA_ROOT = os.path.join(SITE_ROOT, 'media')
MEDIA_URL = '/media/'

Add media template context processor in the

        'OPTIONS': {
            'context_processors': [
                '', # add this line

Add url to display instagram media feed in

urlpatterns = [
    path('instagram/', include('instagram_profile.urls')), # add this line

To serve media files during development need to add following lines to

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Run the database migrations

python migrate


  • 0.1.0 Alpha version

Project details

Release history Release notifications

This version


Download files

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

Files for django-instagram-profile, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django-instagram-profile-0.1.0.tar.gz (7.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

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