Package release

ocyan-plugin-demo-data

mandel/stable ยท Version 1.2.5

Provides basic sample content and fixture registration for Ocyan sites.

Metadata

author MandelBlogStack
classifiers
  • Environment :: Plugins
  • Framework :: Django
  • Programming Language :: Python :: 3.12
  • Programming Language :: Python :: 3.13
description_content_type text/markdown
license Proprietary
provides_extras
  • test
requires_dist
  • ocyan-core<2,>=1.2.14
  • coverage<8,>=7; extra == 'test'
  • ruff<1,>=0.6; extra == 'test'
requires_python <3.14,>=3.12

Release files

FileTest resultsHistory
ocyan_plugin_demo_data-1.2.5-py3-none-any.whl
Size
5 MB
Type
Python Wheel
Python
3
  • Uploaded to mandel/stable by Mandel-publish 2026-08-11 21:42:49
ocyan_plugin_demo_data-1.2.5.tar.gz
Size
5 MB
Type
Source
  • Uploaded to mandel/stable by Mandel-publish 2026-08-11 21:43:07

Ocyan plugin demo data

Installation

Add ocyan.plugin.demo_data to your projects dependencies.

Description

This plugin installs basic content into the website. Each plugin contains their own demo data, which will be aggregated and installed in the project.

Demodata fixtures will only be installed ONCE a record is kept in the database of the installed demodata fixtures. This is needed, because if we would install the fixtures each time, it would overwrite any modifications done in the database.

The demodata fixture record can be found here:

http://127.0.0.1:8000/manage/ocyan_plugin_demo_data/demodatafixture/

By deleting a record, you can force the fixture to be installed again. This can be useful, when installing a new plugin that overrides fixtures of a plugin allready installed.

Usage

Demo data consists of a name, a fixture and optionally a priority. Plugins can register fixtures under a certain key and override the fixtures registered by other plugins by speififying a priority.

An example of a plugin registering demodata by using fixtures:

def contribute_to_fixtures(self, fixtures):
    fixtures.add("data", "plugin/data")
    fixtures.add("wagtailhome", "superhome/home", 7) # with high priority 7
    return fixtures

Signals

The demodata plugin sends 2 signals, to which plugins can respond to perform additional actions, like copying images or creating data that is more dynamic than can be stored in a fixture.

  1. django.core.signals.pre_loaddemodata providing_args=["has_unloaded_fixtures"]
  2. django.core.signals.post_loaddemodata providing_args=["has_unloaded_fixtures"]

The has_unloaded_fixtures argument designates if there are any fixtures that will be loaded this run. Use that argument for tasks that shpuld not run every time the demodata is loaded, only when actual loading is being performed.

Install the demodata

While the demodata will usually be installed into the project automatically, you can run it manually also. To manually run the demo data installation, run

manage.py loaddemodata