Frontend module is the extension of Django application config.


class material.frontend.apps.ModuleMixin

Extension for the django AppConfig. Makes django app pluggable at runtime.

The application have to have <app_module>/ file, with a single no-parametrized url with name=’index’, ex:

urlpatterns = [
    path('', generic.TemplateView.as_view(template_name="sales/index.html"), name="index"),

All AppConfigs urls will be included into material.frontend.urls automatically under /<app_label>/ prefix The AppConfig.label, used for the urls namespace.

The menu.html sample:

    <li><a href="{% url 'sales:index' %}">Dashboard</a></li>
    <li><a href="{% url 'sales:customers' %}">Customers</a></li>
    {% if perms.sales.can_add_lead %}<li><a href="{% url 'sales:leads' %}">Leads</a></li>{% endif %}

In all application templates, the current application config instance would be available as current_module template variable

  • order – The relative module order priority. Modules in the site menu would be listed according its priorities.

  • icon – The module icon.


class Sales(ModuleMixin, AppConfig):
    name = 'sales'
    icon = '<i class="material-icons">call</i>'

Base template for a module.

If <app_label>/base_module.html exists it would be used. The default is ‘material/frontend/base_module.html’

Intended to use in modules generic templates. Ex:

{% extends current_module.base_template %}

Module description.

By default taken from the module docstring.


Check is user have permission to access to the module.


Entry url for a module.

property installed

Check the module installation state.

Default implementation store installed state in the database frontend_dbmodule table.


Load module menu template.

Template should be located in <app_label>/menu.html

If no template exists, no exception raised.

Intended to use with {% include %} template tag:

{% include %}
property urls

Module url config.

By default it would be loaded from ‘<app>/’

property verbose_name

Module name.