Migrating

Starting from version 3.0, this file tracks any changes one needs to make to update to the listed version. Please note that this does not include all new features of a given release.

There are three kinds of changes: - Required: stuff won’t work (correctly) if you don’t do this - Recommended: stuff won’t work in a future version if you don’t do this - Optional: changes that are not (and wil not be) necessary, but is recommended to use anyway

3.0

Required

Namespace change

3.0 moves all apps from the uil namespace to the cdh namespace. It should be enough just to replace all uil.* imports to cdh.*.

Please remember to update the MIDDLEWARE and INSTALLED_APPS settings and the url config imports as well.

REST Client

uil.rest_client has been replaced in favor of cdh.rest, which also includes code for REST servers.

In practice, migrating should be as simple as replacing uil.rest_client imports with cdh.rest.client. (The base package does not import anything.)

REST Serializers

uil.core.rest.serializers has been moved to cdh.rest.server.serializers.

Bootstrap update

We now use a completely new CSS stack, based upon Bootstrap 5. This brings several breaking changes. Please see the migration documentation.

In addition, table based forms now need the .table class to be applied to the <table>

Optional

Custom SCSS setup

The new bootstrap theme is built using SCSS. For ease of use, this library supplies a pre-built version that is enabled by default.

If you require overrides which cannot be done using the CSS vars, you can create your own SCSS setup. The easiest way to get started is probably to copy both package.json and the scss folder to your project.

Then, change the build commands to output the generated CSS into one of your Django app’s static/cdh.core folder. (Note: you might need to play around with your app loading order to make sure your local version overrides the provided ones)

INSTALLED_APPS import order

3.0 introduces some overrides for Django Admin and Django Impersonate templates.

To ensure proper overriding of said templates, it’s recommended to move all cdh.* apps to the top of INSTALLED_APPS.

‘Status’ indicator

The updated base template will add warnings to the header if you’re

  • Running in debug mode (Local Development Server)

  • Impersonating a user (Impersonating user - {user})

  • Running on an acceptation server (Acceptation Server)

The first two work out of the box, but for the acceptation warning to work you’ll need to:

  • Add 'cdh.core.context_processors.acceptation' to the context_processors settings in TEMPLATES

  • Create a new ACCEPTATION boolean setting (recommended to place next to DEBUG)