Unicorn stores all settings in a dictionary under the UNICORN attribute in the Django settings file. All settings are optional.

    "APPS": ["unicorn",],
    "CACHE_ALIAS": "default",
    "MINIFY_HTML": False,
    "MINIFIED": True,
    "SERIAL": {
        "ENABLED": False,
        "TIMEOUT": 60,
    "SCRIPT_LOCATION": "after",


Specify the modules to look for components. Defaults to ["unicorn",].


The alias to use for caching. Only used by the experimental serialization of requests for now. Defaults to "default".


Minify the HTML generated by Unicorn in the AJAX request. If set to True and htmlmin is installed HTML will be minified. htmlmin can be installed with Unicorn via poetry add django-unicorn[minify] or pip install django-unicorn[minify]. Defaults to False.


Provides a way to control if the minified version of the JavaScript bundle (i.e. unicorn.min.js) is used. Defaults to !DEBUG.


Whether or not script elements in a template should be “re-run” after a template has been re-rendered.


Settings for the experimental serialization of requests. Defaults to {}.


Whether slow requests to the same component should be queued or not. Defaults to False.


The number of seconds to wait for a request to finish for additional requests to queue behind it. Defaults to 60.


Where the initial JavaScript data is included on initial render. Two values are currently supported: after and append.

after is the default and will render the JavaScript outside of the HTML component, i.e. it will be output in the same hierarchy as the parent of the HTML component.

append will render the JavaScript inside of the HTML component.