Skip to main content

Django CSS Inline

Project description

Simple helper for loading CSS files as inline in HTML with Django.

Example :

{% load css_inline %}



    {% css_inline %}
        <link rel="stylesheet" href="/static/django_css_inline/test-1.css">
        <link rel="stylesheet" href="/static/django_css_inline/test-2.css">
        <link rel="stylesheet" href="">
    {% end_css_inline %}

Every <link> includes between {% css_inline %} and {% end_css_inline %} give this results :


    <style type="text/css">

        /* test-1.css styles */
        /* test-2.css styles */
        /* test-3.css styles */



Install with pip :

pip install django-css-inline

Add django_css_inline to django apps installed :


In, chose to enable or disable django_css_inline. For example :

# Default True

If you use static files with Django, don’t forget to collect them with :

python collectstatic

Project details

Download files

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

Source Distribution

django_css_inline-0.0.6.tar.gz (16.2 kB view hashes)

Uploaded source

Built Distribution

django_css_inline-0.0.6-py3-none-any.whl (17.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page