跳转到主要内容

内容管理系统:页面是(有序)块和相关内容的列表。虽然允许内联i18n内容管理,但具有高性能。

项目描述

============================= django-stack-it

.. image:: https://api.codacy.com/project/badge/Grade/4c1f910320434a5fb2fb828ebfcbaf95 :alt: Codacy徽章 :target: https://app.codacy.com/app/Jufik/django_stack_it?utm_source=github.com&utm_medium=referral&utm_content=VingtCinq/django_stack_it&utm_campaign=Badge_Grade_Dashboard

.. image:: https://badge.fury.io/py/django-stack-it.svg :target: https://badge.fury.io/py/django-stack-it

.. image:: https://api.codacy.com/project/badge/Coverage/a842b7f950cd465d91d6b06c7d56ce16
:target: https://www.codacy.com/app/Jufik/django_stack_it?utm_source=github.com&utm_medium=referral&utm_content=VingtCinq/django_stack_it&utm_campaign=Badge_Coverage

.. image:: https://travis-ci.org/VingtCinq/django_stack_it.svg?branch=master :target: https://travis-ci.org/VingtCinq/django_stack_it

开发中的内容管理系统

快速入门

安装django-stack-it:

pip install django-stack-it

Django Stack It依赖于几个依赖项,您需要将其添加到您的INSTALLED_APPS中

.. code-block:: python

INSTALLED_APPS = (
    ...
    'polymorphic_tree',
    'polymorphic',
    'mptt',
    'imagekit',
    'stack_it'
    ...
)

添加django-stack-it的URL模式

.. code-block:: python urlpatterns = [ ... path(r'^', include('stack_it.urls')), ... ]

为了避免迁移混乱,我们强烈建议您将Stack It迁移部署到您的项目中。这将避免由于语言添加/删除而导致的任何意外环境冲突。在您的设置中

.. code-block:: python MIGRATION_MODULES = { "stack_it":"tests.migrations" }

基本用法

一旦模型与URL相关联,它应继承自 Page 模型。

.. code-block:: python from stack_it.models import Page

class Article(Page):
    """
    Your model here
    """
    ....

文章现在被视为页面。它包含一些有用的字段,如 titleslugtemplate_path

按照您的方式将模型注册到管理中,您可以在一个统一的行政界面中查看您网站的所有组织。

.. code-block:: python from stack_it.admin import PageAdmin as BasePageAdmin from stack_it.models import Page from blog.models import Article

class PageAdmin(BasePageAdmin):
    base_model = Page
    child_models = (
        ...Your inherited model here,
        Article,
        ...
    )
 admin.site.register(Page, PageAdmin)

Article 或其他模型将不再显示在管理中。每个模型和模型实例都将从“页面”管理中管理,其中所有页面都组织在拖放界面中,以构建您的网站结构。

如果要将模型注册为常规模型,请在您的管理类中添加 show_in_index = True 以允许

功能

  • 待办事项

运行测试

代码真的能工作吗?

::

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

致谢

用于渲染此包的工具

  • Cookiecutter_
  • cookiecutter-djangopackage_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _cookiecutter-djangopackage: https://github.com/pydanny/cookiecutter-djangopackage

历史

0.1.0 (2019-01-14) ++++++++++++++++++

  • 首次发布在PyPI。

项目详细信息


下载文件

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

源分布

django_stack_it_bak-0.1.13.2.tar.gz (70.9 kB 查看散列)

上传时间

构建分布

django_stack_it_bak-0.1.13.2-py2.py3-none-any.whl (86.5 kB 查看散列)

上传时间 Python 2 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面