Skip to content

plugie_config.json

Alexandre Costa edited this page Aug 13, 2024 · 1 revision

Configuring Plugie is easy and quick. It expects a plugin_config.json file in the root of your Django project directory. This file should contain a JSON object with the following properties:

custom_methods_path (optional)

The path to the directory containing your custom methods. This path should be relative to the root of your project directory. If you don't add this property, Plugie will look for custom methods at plugie/custom_methods.

Read more about Custom Methods and how to add them.

dummy_plugins (optional)

An object with two properties: source and target. The source property should be an array of strings, each string representing a plugin that you want to convert into a dummy plugin. The target property should be a string representing the dummy plugin that you want to use as a target. If you don't need to convert any plugins into dummy plugins, don't include this property.

See how to Create Dummy Plugins.

skip_fields (optional)

An array of strings representing the fields that you want to skip when serializing your plugin. If you don't need to skip any fields, don't include this property.

Read more about Skip Fields.

Example: plugie_config.json

{
    "dummy_plugins": {
        "source": ['Module', 'SomePlugin'],
        "target": 'MyDummyPlugin'
    },
    "skip_fields": ['alias_reference', 'some_unimportant_field'],
    "custom_methods_path": "plugie/custom_methods"
}

Generate a plugin_config.json file

You can generate a plugin_config.json file by running the following command in the root of your project directory:

plugie .

This command will also create a plugie/custom_methods folder with some default serializer-deserializer methods. Check out the Plugie CLI section for more info.