Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Django script pattern app

Project description


This app allows you to add script blocks into your pages using url patterns like:

  • /category/*
  • /*/subcategory/*

# Includes GET parameters

  • /products/catalog/*category=some-category*

Use * to pass any symbols and $ as the end.

Available to use four block locations:

  1. Head - Top
  2. Head - Bottom
  3. Body - Top
  4. Body - Bottom


Install with pip:

$ pip install django-script-pattern


    'django_jinja',  # optional for jinja2 global function

Apply migrations:

$ python migrate

Example to use:

<html lang="en">
        {{ get_script_pattern(request, 'head', 'top') }}
        some head content
        {{ get_script_pattern(request, 'head', 'bottom') }}

        {{ get_script_pattern(request, 'body', 'top') }}
        some body content
        {{ get_script_pattern(request, 'body', 'bottom') }}

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-script-pattern, version 0.3.3
Filename, size File type Python version Upload date Hashes
Filename, size django-script-pattern-0.3.3.tar.gz (9.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page