djangocms插件,可以从googlephotos公共相册链接中获取照片url。
djangocms-scrape-google-photos-album的Python项目详细描述
djangocms刮谷歌相册
djangocms scrape google photos album是一个django CMS的插件 允许你在你的站点中加入一个公共的google相册,通过抓取他们的html。在
警告:由于刮取的性质,此is实现可能会中断。正则表达式将 需要在谷歌改变页面结构时进行更新。
要求
- python 3.5+
- django1.11(其他版本也可以工作,但这是唯一经过测试的版本)
- DjangoCMS3.5(其他版本也可以工作,但这是唯一经过测试的版本)
安装
pip install djangocms-scrape-google-photos-album
使用
注意:结果缓存时间为30分钟。如果这不能满足你的需要, make an issue。在
settings.py
:
^{pr2}$
Override the template 包括在内,因为它可能不是您想要的html。下面是一个如何使用 它带有Bootstrap 3和 featherlight.js。在
/my_project/templates/djangocms_scrape_google_photos_album/album.html
{% if photo_urls %}
<div class="container-fluid">
<div class="row" data-featherlight-gallery data-featherlight-filter="a" data-featherlight-type="image">
{% for photo_url in photo_urls %}
<div class="col-xs-6 col-sm-4 col-md-3">
<a href="{{ photo_url }}=w1200-h1200">
<img src="{{ photo_url }}=w300-h300-c" class="img-responsive" />
</a>
</div>
{% endfor %}
</div>
</div>
{% endif %}
- 项目
标签: