Modifying the settings module

    # ...apps
    # ...another apps

Add the disguise.middleware.DisguiseMiddleware to the MIDDLEWARE list in your settings module. Make sure django.contrib.sessions.middleware.SessionMiddleware in there and follow before the disguise middleware.



Here you can see an example of overriding of the default behavior

    'can_disguise': 'my_project.utils.my_own_can_disguise',
    'widget_form': 'my_project.utils.MyOwnDisguiseWidgetForm',

Modifying urlpatterns

from django.urls import include, path

urlpatterns = [
    path('disguise/', include('disguise.urls')),

Adding widgets to templates

If you plan to use the widget, you should add these lines into templates of pages where you want to:

{% load disguise_tags %}
{% disguise_widget %}

A good idea to add this code into your base template (generally, it called base.html) to make the ability to use the application on any√ page.


$ migrate