Migration steps

This is the official documentation of the forestadmin-agent-django and forestadmin-agent-flask Python agents.

Step 1: Install the new agent and remove the old one

# install new agent
pip3 install forestadmin-agent-django
# uninstall the old one
pip3 uninstall django-forestadmin

Also you have to remove the initialization method call init_forest() (and it's import) from the project/wsgi.py file.

Step 2: modify the settings

The way to use forest settings changes from dictionary to variables:

    'FOREST_ENV_SECRET': 'env secret variable',
    'FOREST_AUTH_SECRET': 'auth secret variable'

In project/urls.py, change the url inclusion:

urlpatterns = [
    path('forest', include('django_forest.urls')),
    # ...
    # if you had any smart view with declared urls, you can remove them
    # path('forest', include('app.urls')),

The settings INCLUDED_MODELS and EXCLUDED_MODELS are now replaced by the options when adding a data source. See the dedicated documentation about adding django data source and collection selection

Step 3: Agent customization

The smart collection feature is removed from agent v2. Read this section to learn how to customize your Django agent v2, and read the next "Code transformations" section to learn how to port your previous smart collections to the new agent.

Last updated