Skip to main content

Manage front end dependencies in Django.

Project description


PyPI Gitlab pipeline status Gitlab coverage

Manage front end dependencies in Django


Create a FE_MANAGER variable in your project settings defining the modules that can be used in your project. An example:

    'bootstrap': {
        'version': '4.0.0',
        'js': ['/static/js/bootstrap.bundle.min.js'],
        'css': ['/static/css/bootstrap.css', '/static/css/custom.css'],
        'dependencies': {'jquery'}
    'jquery': {
        'version': '3.2.1',
        'js': ['/static/private/js/vendors/jquery-3.2.1.min.js']
    'moment': {
        'version': '2.24.0',
        'js': ['']
    'chartjs': {
        'version': '2.9.3',
        'js': [''],
        'dependencies': {'moment'}

In your base view load the module, declare your dependencies, declare a dummy block at the beggining and add the css and js output tags:

{% load fe_manager %}
{% fe_manager_add_module 'bootstrap' %}
{% fe_manager_add_module 'jquery' %}
{% block fe_manager %}{% endblock fe_manager %}
<!DOCTYPE html>
    <!-- Title and other HTML code... -->
    <!-- Output CSS -->
    {% fe_manager_output_css %}
    <!-- Content and other stuff... -->
    {% block content %}{% endblock content%}
    <!-- Output JS -->
    {% fe_manager_output_js %}

Every child view can now add its dependencies in the following way...

{% extends 'base.html' %}

{% load fe_manager %}

{% block fe_manager %}
{% fe_manager_add_module 'chartjs' %}
{% endblock fe_manager %}

{% block content %}
Content here!
{% endblock content %}

The plugin will take care of dependency ordering and outputting both JS and CSS to your base template!


  • Add some documentation


  • Fix packaging (utils package not being included previously).


  • Initial release on PyPi.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-fe-manager, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size django-fe-manager-0.0.3.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page