Skip to main content

Inject custom CSS and JavaScript into the presale pages of individual events.

Project description

pretix-event-css-js

Inject custom CSS and JavaScript into the presale pages of individual events in pretix. Useful for branding tweaks, custom layouts, tracking snippets, or any per-event frontend customization that doesn't warrant a full theme.

Key capabilities:

  • Per-event custom CSS and JavaScript
  • Code editor in the event settings panel
  • Content-hash based cache busting (1-year cache with automatic invalidation on change)
  • Clean removal of settings when the plugin is uninstalled

Screenshot

Settings — custom CSS & JS editor

Settings

How it works

  1. You enter custom CSS and/or JavaScript in the event settings.
  2. The plugin injects a <link> tag (CSS) into the page head and a <script> tag (JS) into the page footer of every presale page for that event.
  3. The CSS and JS are served from dedicated endpoints with a content-hash query parameter for cache busting. Browsers cache them for up to 1 year — when you update the code, the hash changes and browsers fetch the new version automatically.

Installation

pip install pretix-event-css-js

Then restart the server. The plugin registers itself automatically via the pretix.plugin entry point — no manual INSTALLED_APPS edit needed.

Development installation

git clone https://github.com/nicoknoll/pretix-event-css-js.git
cd pretix-event-css-js
pip install -e .

Usage

  1. Enable the plugin for your event under SettingsPlugins.
  2. Go to SettingsEvent-CSS & JS in the event control panel.
  3. Enter your custom CSS and/or JavaScript and save.

Your code will be loaded on every presale page of that event.

Heads up: Faulty JavaScript can break the checkout flow for your customers. Test thoroughly before going live.

Dependencies

Package Purpose
pretix >= 2.7.0 Host platform

Python 3.10+ required. No additional dependencies beyond pretix itself.

License

MIT — see LICENSE.

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

pretix_event_css_js-1.0.0.tar.gz (239.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pretix_event_css_js-1.0.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file pretix_event_css_js-1.0.0.tar.gz.

File metadata

  • Download URL: pretix_event_css_js-1.0.0.tar.gz
  • Upload date:
  • Size: 239.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for pretix_event_css_js-1.0.0.tar.gz
Algorithm Hash digest
SHA256 75c43f94584b4122335b649a5ad5dceb014a42a63e5a1147e554dce348a96d37
MD5 f08368aecb60cf2e5d5dd52da80b8f8d
BLAKE2b-256 30c4180636b5b6a19346fa0ba668a651b7772004aff66d97769c0a746b03d403

See more details on using hashes here.

File details

Details for the file pretix_event_css_js-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pretix_event_css_js-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82e0a811921e9abbc54f5037cce7d6461961977ea33f363bfe0134c26f691c4f
MD5 8b5c33ec32f4957c6a3aed28e9bf469f
BLAKE2b-256 992e8840f016f767cfd4a0b62e52cd6dfcabbc76b5e7a4c6e07917b0af41f952

See more details on using hashes here.

Supported by

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