Connect Mezzanine sites to Instagram feeds.
- Install via pip:
pip install mezzanine-instagram-feed
. - Add
instagramfeed
to yourINSTALLED_APPS
.
Load the templatetag library and pass the username you want to query to the instagram_posts
template tag.
{% load instagramfeed_tags %}
{% instagram_posts "USERNAME HERE" as posts %}
{% for posts in post %}
<a href="https://instagram.com/p/{{ post.shortcode }}">
<img src="{{ post.thumbnail_src }}" alt="{{ post.edge_media_to_caption.edges.0.node.text }}">
</a>
{% endfor %}
Keep in mind requests to Instagram are cached for 8 hours so new page loads don't always trigger new requests.
Configuration variables read from settings.py
:
Setting | Default | Description |
---|---|---|
SCRAPERAPI_KEY |
None |
If set will use scraperapi.com to proxy requests to Instagram |
Review contribution guidelines at CONTRIBUTING.md.