Skip to main content

Aldryn Addons Framework

Project description

pypi build coverage

Aldryn Addons are re-usable django apps that follow certain conventions to abstract out complicated configuration from the individual django website project into upgradable packages. With this approach it is possible to avoid repetitive “add this to INSTALLED_APPS and that to MIDDLEWARE_CLASSES and add these to urls.py” work. The settings logic is bundled with the addon and only interesting “meta” settings are exposed. It is a framework to utilise such addons in django projects.

The goal is to keep the footprint inside the django website project as small as possible, so updating things usually just mean bumping a version in requirements.txt and no other changes in the project.

This addon still uses the legacy “Aldryn” naming. You can read more about this in our support section.

Contributing

This is a an open-source project. We’ll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your pull request, please review our contribution guidelines.

We’re grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section.

Documentation

See REQUIREMENTS in the setup.py file for additional dependencies:

python django

Installation

aldryn-addons is part of the Divio Cloud platform.

For a manual install:

Add aldryn-addons to your projects requirements.txt or pip install it. It is also highly recommended to install aldryn-django. This is django itself bundled as an addon:

pip install aldryn-addons aldryn-django==1.6.11

At the top if the settings.py add the following code snippet:

INSTALLED_ADDONS = [
    'aldryn-django',
]

# add your own settings here that are needed by the installed Addons

import aldryn_addons.settings
aldryn_addons.settings.load(locals())

# add any other custom settings here

Addons can automatically add code to the root urls.py so it’s necessary to add aldryn_addons.urls.patterns() and aldryn_addons.urls.i18n_patterns(). The code below is for Django 1.8 and above. For older versions of Django, please add the prefix parameter to i18n_patterns: i18n_patterns('', ...

from django.urls import re_path, include
from django.conf.urls.i18n import i18n_patterns
import aldryn_addons.urls


urlpatterns = [
    # add your own patterns here
] + aldryn_addons.urls.patterns() + i18n_patterns(
    # add your own i18n patterns here
    re_path(r'^myapp/', include('myapp.urls')),
    *aldryn_addons.urls.i18n_patterns()  # MUST be the last entry!
)

Please follow the installation instructions for aldryn-django for complete integration. Then follow the setup instructions for aldryn-django-cms for the examples below.

Adding Addons

In this example we’re going to install django CMS Link, which requires Aldryn django CMS.

pip install the Addon:

pip install djangocms-link

Add it to INSTALLED_ADDONS in settings.py:

INSTALLED_ADDONS = [
    'aldryn-django',
    'aldryn-cms',
    'djangocms-link',
]

Copy aldryn_config.py and addon.json from the addon into the addons directory within your project (addons/djangocms-link/aldryn_config.py and addons/djangocms-link/addon.json). If aldryn_config.py defines any settings on the settings Form, put them in addons/djangocms-link/settings.json, if not put {} into it.

You are all set. The code in aldryn_config.py will take care of configuring the addon.

Running Tests

You can run tests by executing:

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aldryn-addons-2.0.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

aldryn_addons-2.0.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file aldryn-addons-2.0.1.tar.gz.

File metadata

  • Download URL: aldryn-addons-2.0.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for aldryn-addons-2.0.1.tar.gz
Algorithm Hash digest
SHA256 d0f028b610f7fd4467e98b037950de3e1100a6f3de076a459d327cda2bdf6a64
MD5 de88abc65742e107121c9447b2d33c71
BLAKE2b-256 fe68a89f590351e454134328c08b1de48e48120d91f2eefac023cdec68b8343a

See more details on using hashes here.

Provenance

File details

Details for the file aldryn_addons-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: aldryn_addons-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for aldryn_addons-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad5ac363aeb8edc1817da1df6ad8e26252702f7ec2a5221f1fce7a88b28d843
MD5 8488e0b889d97ac09dc90b310fdcdb8b
BLAKE2b-256 6591f91247b310450162d629148bb0d45553c74462b539ddb154a4ba0d0e9ac7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page