Skip to main content

Django CMS DAG Jetcode is a plugin for Django CMS that allows you to add DAG System's Jetcodes on your site.

Project description

djangocms-dag-jetcode

Django CMS DAG Jetcode is a plugin for Django CMS that allows you to add DAG System's Jetcodes on your site.

preview djangocms-dag-jetcode

Requirements

  • Python 3.8+
  • Django 2.0+
  • Django CMS 3.8.0+

Installation

  • run pip install djangocms-dag-jetcode
  • add djangocms_dag_jetcode to your INSTALLED_APPS
  • run python manage.py migrate djangocms_dag_jetcode
  • import DAG's scripts before the closing </body> tag
    <script src="https://jetcode.dag-system.com/jetcodes/fr?customerID=<your customer id>" defer></script>
    

You can override some files to customize the style:

  • static/djangocms_dag_jetcode/css/base.css base style for all Jetcodes
  • static/djangocms_dag_jetcode/css/product.css product Jetcodes
  • static/djangocms_dag_jetcode/css/productselector.css product selector Jetcodes
  • static/djangocms_dag_jetcode/css/package.css package Jetcodes
  • static/djangocms_dag_jetcode/img/calendar-icon.png the calendar icon
  • templates/djangocms_dag_jetcode/default.html the template used to render the Jetcodes

Settings

Styles choices

DJANGOCMS_DAG_JETCODE_STYLE_CHOICES = [
  ("my-style", "My custom style"),
]

defaults to []

Each style defined in this setting must have a corresponding CSS file in {STATIC_ROOT}/djangocms_dag_jetcode/css/ (for example: my-style.css).

Cache timeout

Set the cache timeout for the get_css view.

DJANGOCMS_DAG_JETCODE_CACHE_TIMEOUT = 15 * 60

defaults to 15 * 60 (15 minutes)

When DEBUG=True, you can set this setting to 0 to disable the cache.

Reload Jetcode after CMS plugin edit

When you add or edit a plugin, the CMS does not reload the entire page. You should re-instantiate the Jetcodes to display them without a page refresh. Add this code to your pages:

if (window.hasOwnProperty('CMS') === true) {
  CMS.$(window).on('cms-content-refresh', function () {
    initJetcode()
  }
}

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

djangocms_dag_jetcode-1.0.3.tar.gz (15.9 kB view hashes)

Uploaded Source

Built Distribution

djangocms_dag_jetcode-1.0.3-py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 3

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