Skip to main content

feincms 画廊的简单实现

项目描述

feincms_simplegallery 是 feincms 画廊的简单实现

快速开始

  1. 将“feincms_simplegallery”添加到您的 INSTALLED_APPS 设置中,如下所示:

    INSTALLED_APPS = (
        ...
        'feincms_simplegallery',
    )
  2. 如果您打算将其用作 feincms 内容类型,请为您的 Page 模型(或任何其他 Base 派生模型)注册 GalleryContent,如下所示:

    from feincms_simplegallery.models import GalleryContent
    # ...
    Page.create_content_type(GalleryContent)
  3. (可选)如果您想使用不同的模板呈现画廊,可以为 GalleryContent 定义 TYPE_CHOICES:

    from feincms_simplegallery.models import GalleryContent
    # ...
    Page.create_content_type(GalleryContent, TYPE_CHOICES=(
            ('default', 'default template'),
            ('other', 'some other template'),
            # ... (other types)
        )
    )
    
    # galleries will be rendered as either of these, depending on admin choice:
    # templates/content/feincms_simplegallery/default.html
    # templates/content/feincms_simplegallery/other.html
    # ...
    
    Some of the templates (grid and lightbox) are bundled with the plugin
  4. 迁移模型

下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

feincms_simplegallery-0.3.1.tar.gz (13.1 kB 查看哈希

已上传 source

内置分布

feincms_simplegallery-0.3.1-py2.py3-none-any.whl (18.2 kB 查看哈希

已上传 py2 py3